JSPM

isolated-runtime-test-commons

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q38786F
  • License ISC

Isolated Runtime Test Commons

Package Exports

  • isolated-runtime-test-commons

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (isolated-runtime-test-commons) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Isolated Runtime Test Commons

Used to create fixture files for testing isolated runtime.

Api

  • Context({basePath?: string, root?: string}) - Create a new context, which will operate under basePath/root

  • Context.DEFAULT_FILE_NAME: string - default file name used in case no file name was passed to withFile.

  • Context#withFile(file?: string, content: string): this - Used to add a file to the folder.

  • Context#withFunction(name: string, args: Array<string>, content: string): this - Shortcut for withFile. creates a single exported function with the default file name.

  • Context#get basePath(): string - Getter for basePath (full path for code folder).

  • Context#build(): Promise<> - Creates the folders structure.

  • Context#destroy(): Promise<> - Cleans up the folders structure.

  • randoms$#ecret(): string - Generates a random secret.

  • randoms#folder(): string - Generates a random folder name.