Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/deno_slack_hooks/dev_deps.ts>mockFile.prepareVirtualFile

Helper library implementing the contract between the Slack CLI and Slack application SDKs
Go to Latest
function mockFile.prepareVirtualFile
import { mockFile } from "https://deno.land/x/deno_slack_hooks@0.9.0/dev_deps.ts";
const { prepareVirtualFile } = mockFile;

Preloads virtual file that will be opened/read later.

Parameters

path: string | URL

Path to file.

optional
content = [UNSUPPORTED]

Content of file. Default to empty Uint8Array.

optional
fileInfo: Partial<Deno.FileInfo> = [UNSUPPORTED]

The object used as the return value of file.stat.

import { prepareVirtualFile } from "https://deno.land/x/mock_file@$VERSION/mod.ts";

const content = new TextEncoder().encode("hello world");
prepareVirtualFile("./no/such/file.txt", content);

const file = Deno.openSync("./no/such/file.txt");