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 +1 -0
- package/README.md +1 -1
- package/assembly/index.ts +1 -1
- package/bin/index.js +1 -1
- package/bin/init.js +2 -2
- package/bin/run.js +1 -1
- package/cli/index.ts +1 -1
- package/cli/init.ts +2 -2
- package/cli/run.ts +1 -1
- package/package.json +1 -1
- package/run/package.json +1 -1
- package/transform/package.json +1 -1
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
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:
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
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.
|
|
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.
|
|
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.
|
|
45
|
+
chalk.dim("\n------------------- v0.3.3 -------------------\n"),
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
48
|
|
package/package.json
CHANGED
package/run/package.json
CHANGED