|
| 1 | +module.exports = { |
| 2 | + /** |
| 3 | + * A set of globs passed to the glob package that qualify typescript files for testing. |
| 4 | + */ |
| 5 | + include: ["assembly/__tests__/**/*.spec.ts"], |
| 6 | + /** |
| 7 | + * A set of globs passed to the glob package that quality files to be added to each test. |
| 8 | + */ |
| 9 | + add: ["assembly/__tests__/**/*.include.ts"], |
| 10 | + /** |
| 11 | + * All the compiler flags needed for this test suite. Make sure that a binary file is output. |
| 12 | + */ |
| 13 | + flags: { |
| 14 | + /** To output a wat file, uncomment the following line. */ |
| 15 | + // "--textFile": ["output.wat"], |
| 16 | + /** A runtime must be provided here. */ |
| 17 | + "--runtime": ["stub"], // Acceptable values are: full, half, stub (arena), and none |
| 18 | + "--target": "test", |
| 19 | + }, |
| 20 | + /** |
| 21 | + * A set of regexp that will disclude source files from testing. |
| 22 | + */ |
| 23 | + disclude: [/node_modules/], |
| 24 | + /** |
| 25 | + * Add your required AssemblyScript imports here. |
| 26 | + */ |
| 27 | + imports(memory, createImports, instantiateSync, binary) { |
| 28 | + let instance; // Imports can reference this |
| 29 | + const myImports = { |
| 30 | + // put your web assembly imports here, and return the module |
| 31 | + }; |
| 32 | + instance = instantiateSync(binary, createImports(myImports)); |
| 33 | + return instance; |
| 34 | + }, |
| 35 | + /** |
| 36 | + * Add a custom reporter here if you want one. The following example is in typescript. |
| 37 | + * |
| 38 | + * @example |
| 39 | + * import { TestReporter, TestGroup, TestResult, TestContext } from "as-pect"; |
| 40 | + * |
| 41 | + * export class CustomReporter extends TestReporter { |
| 42 | + * // implement each abstract method here |
| 43 | + * public abstract onStart(suite: TestContext): void; |
| 44 | + * public abstract onGroupStart(group: TestGroup): void; |
| 45 | + * public abstract onGroupFinish(group: TestGroup): void; |
| 46 | + * public abstract onTestStart(group: TestGroup, result: TestResult): void; |
| 47 | + * public abstract onTestFinish(group: TestGroup, result: TestResult): void; |
| 48 | + * public abstract onFinish(suite: TestContext): void; |
| 49 | + * } |
| 50 | + */ |
| 51 | + // reporter: new CustomReporter(), |
| 52 | + /** |
| 53 | + * Specify if the binary wasm file should be written to the file system. |
| 54 | + */ |
| 55 | + outputBinary: false, |
| 56 | +}; |
0 commit comments