as-test 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -26,3 +26,4 @@ v0.2.1 - Remove accidental logging
26
26
  v0.3.0 - Pass metadata through terminal - Support for multiple files - Better reporting - Timing for suites - Terminal utilities
27
27
  v0.3.1 - Add screenshot of completed tests to readme
28
28
  v0.3.2 - Add `mockImport` to override imported functions
29
+ v0.3.3 - Allow `mockImport`'s return type to be any
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  | _ || __| ___|_ _|| __|| __||_ _|
4
4
  | ||__ ||___| | | | __||__ | | |
5
5
  |__|__||_____| |_| |_____||_____| |_|
6
- v0.3.2
6
+ v0.3.3
7
7
  </pre>
8
8
  </h5>
9
9
 
package/assembly/index.ts CHANGED
@@ -225,7 +225,7 @@ export function afterEach(callback: () => void): void {
225
225
  */
226
226
  export function mockFn(oldFn: Function, newFn: Function): void {}
227
227
 
228
- export function mockImport(oldFn: string, newFn: () => string): void {
228
+ export function mockImport<T extends Function>(oldFn: string, newFn: T): void {
229
229
  __mock_import.set(oldFn, newFn.index);
230
230
  // mocks.set(oldFn, new MockFn(oldFn, newFn).enable());
231
231
  }
package/bin/index.js CHANGED
@@ -7,7 +7,7 @@ const _args = process.argv.slice(2);
7
7
  const flags = [];
8
8
  const args = [];
9
9
  const COMMANDS = ["run", "build", "test", "init"];
10
- const version = "0.3.2";
10
+ const version = "0.3.3";
11
11
  for (const arg of _args) {
12
12
  if (arg.startsWith("-")) flags.push(arg);
13
13
  else args.push(arg);
package/bin/init.js CHANGED
@@ -9,7 +9,7 @@ export async function init(args) {
9
9
  input: process.stdin,
10
10
  output: process.stdout,
11
11
  });
12
- console.log(chalk.bold("as-test init v0.3.2") + "\n");
12
+ console.log(chalk.bold("as-test init v0.3.3") + "\n");
13
13
  console.log(chalk.dim("[1/3]") + " select a target [wasi/bindings]");
14
14
  const target = await ask(chalk.dim(" -> "), rl);
15
15
  if (!TARGETS.includes(target)) {
@@ -183,7 +183,7 @@ const exports = instantiate(module, {});`,
183
183
  }
184
184
  if (!pkg["devDependencies"]) pkg["devDependencies"] = {};
185
185
  if (!pkg["devDependencies"]["as-test"])
186
- pkg["devDependencies"]["as-test"] = "^0.3.2";
186
+ pkg["devDependencies"]["as-test"] = "^0.3.3";
187
187
  if (target == "bindings") {
188
188
  pkg["type"] = "module";
189
189
  }
package/bin/run.js CHANGED
@@ -35,7 +35,7 @@ export async function run() {
35
35
  chalk.bold.blueBright(`|__|__||_____| |_| |_____||_____| |_| `),
36
36
  );
37
37
  console.log(
38
- chalk.dim("\n------------------- v0.3.2 -------------------\n"),
38
+ chalk.dim("\n------------------- v0.3.3 -------------------\n"),
39
39
  );
40
40
  }
41
41
  for (const plugin of Object.keys(config.plugins)) {
package/cli/index.ts CHANGED
@@ -11,7 +11,7 @@ const args: string[] = [];
11
11
 
12
12
  const COMMANDS: string[] = ["run", "build", "test", "init"];
13
13
 
14
- const version = "0.3.2";
14
+ const version = "0.3.3";
15
15
 
16
16
  for (const arg of _args) {
17
17
  if (arg.startsWith("-")) flags.push(arg);
package/cli/init.ts CHANGED
@@ -9,7 +9,7 @@ export async function init(args: string[]) {
9
9
  input: process.stdin,
10
10
  output: process.stdout,
11
11
  });
12
- console.log(chalk.bold("as-test init v0.3.2") + "\n");
12
+ console.log(chalk.bold("as-test init v0.3.3") + "\n");
13
13
  console.log(chalk.dim("[1/3]") + " select a target [wasi/bindings]");
14
14
  const target = await ask(chalk.dim(" -> "), rl);
15
15
  if (!TARGETS.includes(target)) {
@@ -192,7 +192,7 @@ const exports = instantiate(module, {});`,
192
192
  }
193
193
  if (!pkg["devDependencies"]) pkg["devDependencies"] = {};
194
194
  if (!pkg["devDependencies"]["as-test"])
195
- pkg["devDependencies"]["as-test"] = "^0.3.2";
195
+ pkg["devDependencies"]["as-test"] = "^0.3.3";
196
196
  if (target == "bindings") {
197
197
  pkg["type"] = "module";
198
198
  }
package/cli/run.ts CHANGED
@@ -42,7 +42,7 @@ export async function run() {
42
42
  chalk.bold.blueBright(`|__|__||_____| |_| |_____||_____| |_| `),
43
43
  );
44
44
  console.log(
45
- chalk.dim("\n------------------- v0.3.2 -------------------\n"),
45
+ chalk.dim("\n------------------- v0.3.3 -------------------\n"),
46
46
  );
47
47
  }
48
48
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "as-test",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Testing framework for AssemblyScript. Compatible with WASI or Bindings ",
5
5
  "types": "assembly/index.ts",
6
6
  "author": "Jairus Tanaka",
package/run/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@as-test/run",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Testing framework for AssemblyScript. Compatible with WASI or Bindings ",
5
5
  "main": "./lib/index.js",
6
6
  "author": "Jairus Tanaka",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@as-test/transform",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Testing framework for AssemblyScript. Compatible with WASI or Bindings ",
5
5
  "main": "./lib/index.js",
6
6
  "author": "Jairus Tanaka",