as-test 0.4.0 → 0.4.2
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 +10 -1
- package/README.md +12 -12
- package/as-test.config.json +1 -1
- package/assembly/__tests__/array.spec.ts +3 -3
- package/assembly/src/expectation.ts +29 -16
- package/assembly/src/suite.ts +2 -0
- package/assembly/src/tests.ts +1 -0
- package/bin/build.js +65 -77
- package/bin/index.js +130 -160
- package/bin/init.js +96 -109
- package/bin/reporter.js +1 -1
- package/bin/run.js +210 -236
- package/bin/types.js +25 -25
- package/bin/util.js +35 -42
- package/cli/run.ts +13 -15
- package/cli/tsconfig.json +2 -1
- package/package.json +12 -9
- package/transform/lib/builder.js +1361 -0
- package/transform/lib/builder.js.map +1 -0
- package/transform/lib/coverage.js +6 -6
- package/transform/lib/coverage.js.map +1 -1
- package/transform/lib/index.js +1 -1
- package/transform/lib/index.js.map +1 -1
- package/transform/lib/linker.js +19 -0
- package/transform/lib/linker.js.map +1 -0
- package/transform/lib/mock.js +9 -9
- package/transform/lib/mock.js.map +1 -1
- package/transform/lib/range.js +13 -0
- package/transform/lib/range.js.map +1 -0
- package/transform/lib/types.js +26 -0
- package/transform/lib/types.js.map +1 -0
- package/transform/lib/util.js +47 -0
- package/transform/lib/util.js.map +1 -0
- package/transform/lib/visitor.js +532 -0
- package/transform/lib/visitor.js.map +1 -0
- package/transform/src/builder.ts +1474 -0
- package/transform/src/coverage.ts +6 -7
- package/transform/src/index.ts +1 -2
- package/transform/src/linker.ts +41 -0
- package/transform/src/mock.ts +9 -10
- package/transform/src/range.ts +12 -0
- package/transform/src/types.ts +35 -0
- package/transform/src/util.ts +81 -0
- package/transform/src/visitor.ts +744 -0
- package/.trunk/configs/.markdownlint.yaml +0 -2
- package/.trunk/configs/.yamllint.yaml +0 -7
- package/.trunk/trunk.yaml +0 -34
- package/bin/about.js +0 -135
- package/bin/package.json +0 -3
package/.trunk/trunk.yaml
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# This file controls the behavior of Trunk: https://docs.trunk.io/cli
|
|
2
|
-
# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml
|
|
3
|
-
version: 0.1
|
|
4
|
-
cli:
|
|
5
|
-
version: 1.22.10
|
|
6
|
-
# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins)
|
|
7
|
-
plugins:
|
|
8
|
-
sources:
|
|
9
|
-
- id: trunk
|
|
10
|
-
ref: v1.6.7
|
|
11
|
-
uri: https://github.com/trunk-io/plugins
|
|
12
|
-
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
|
|
13
|
-
runtimes:
|
|
14
|
-
enabled:
|
|
15
|
-
- node@18.20.5
|
|
16
|
-
- python@3.10.8
|
|
17
|
-
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
|
|
18
|
-
lint:
|
|
19
|
-
enabled:
|
|
20
|
-
- actionlint@1.7.7
|
|
21
|
-
- checkov@3.2.382
|
|
22
|
-
- git-diff-check
|
|
23
|
-
- markdownlint@0.44.0
|
|
24
|
-
- oxipng@9.1.4
|
|
25
|
-
- prettier@3.5.3
|
|
26
|
-
- trufflehog@3.88.15
|
|
27
|
-
- yamllint@1.35.1
|
|
28
|
-
actions:
|
|
29
|
-
disabled:
|
|
30
|
-
- trunk-announce
|
|
31
|
-
- trunk-check-pre-push
|
|
32
|
-
- trunk-fmt-pre-commit
|
|
33
|
-
enabled:
|
|
34
|
-
- trunk-upgrade-available
|
package/bin/about.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
export function about() {
|
|
3
|
-
console.log(
|
|
4
|
-
chalk.bold.blueBright("as-test") +
|
|
5
|
-
" is a testing framework for AssemblyScript. " +
|
|
6
|
-
chalk.dim("(v" + version + ")") +
|
|
7
|
-
"\n",
|
|
8
|
-
);
|
|
9
|
-
console.log(
|
|
10
|
-
chalk.bold("Usage: as-test") +
|
|
11
|
-
" " +
|
|
12
|
-
chalk.dim("<command>") +
|
|
13
|
-
" " +
|
|
14
|
-
chalk.bold.blueBright("[...flags]") +
|
|
15
|
-
" " +
|
|
16
|
-
chalk.bold("[...args]") +
|
|
17
|
-
" " +
|
|
18
|
-
chalk.dim("(alias: ast)") +
|
|
19
|
-
"\n",
|
|
20
|
-
);
|
|
21
|
-
console.log(chalk.bold("Commands:"));
|
|
22
|
-
console.log(
|
|
23
|
-
" " +
|
|
24
|
-
chalk.bold.blueBright("run") +
|
|
25
|
-
" " +
|
|
26
|
-
chalk.dim("<my-test.spec.ts>") +
|
|
27
|
-
" " +
|
|
28
|
-
"Run unit tests with selected runtime",
|
|
29
|
-
);
|
|
30
|
-
console.log(
|
|
31
|
-
" " +
|
|
32
|
-
chalk.bold.blueBright("build") +
|
|
33
|
-
" " +
|
|
34
|
-
chalk.dim("<my-test.spec.ts>") +
|
|
35
|
-
" " +
|
|
36
|
-
"Build unit tests and compile",
|
|
37
|
-
);
|
|
38
|
-
console.log(
|
|
39
|
-
" " +
|
|
40
|
-
chalk.bold.blueBright("test") +
|
|
41
|
-
" " +
|
|
42
|
-
chalk.dim("<my-test.spec.ts>") +
|
|
43
|
-
" " +
|
|
44
|
-
"Build and run unit tests with selected runtime" +
|
|
45
|
-
"\n",
|
|
46
|
-
);
|
|
47
|
-
console.log(
|
|
48
|
-
" " +
|
|
49
|
-
chalk.bold.magentaBright("init") +
|
|
50
|
-
" " +
|
|
51
|
-
chalk.strikethrough.dim("") +
|
|
52
|
-
" " +
|
|
53
|
-
"Initialize an empty testing template",
|
|
54
|
-
);
|
|
55
|
-
console.log(
|
|
56
|
-
" " +
|
|
57
|
-
chalk.strikethrough.bold.magentaBright("config") +
|
|
58
|
-
" " +
|
|
59
|
-
chalk.strikethrough.dim("as-test.config.json") +
|
|
60
|
-
" " +
|
|
61
|
-
"Specify the configuration file",
|
|
62
|
-
);
|
|
63
|
-
console.log(
|
|
64
|
-
" " +
|
|
65
|
-
chalk.strikethrough.bold.magentaBright("reporter") +
|
|
66
|
-
" " +
|
|
67
|
-
chalk.strikethrough.dim("<tap>") +
|
|
68
|
-
" " +
|
|
69
|
-
"Specify the test reporter to use",
|
|
70
|
-
);
|
|
71
|
-
console.log(
|
|
72
|
-
" " +
|
|
73
|
-
chalk.strikethrough.bold.magentaBright("use") +
|
|
74
|
-
" " +
|
|
75
|
-
chalk.strikethrough.dim("wasmtime") +
|
|
76
|
-
" " +
|
|
77
|
-
"Specify the runtime to use" +
|
|
78
|
-
"\n",
|
|
79
|
-
);
|
|
80
|
-
console.log(chalk.bold("Flags:"));
|
|
81
|
-
console.log(
|
|
82
|
-
" " +
|
|
83
|
-
chalk.strikethrough.dim("run") +
|
|
84
|
-
" " +
|
|
85
|
-
chalk.strikethrough.bold.blue("--coverage") +
|
|
86
|
-
" " +
|
|
87
|
-
"Use code coverage",
|
|
88
|
-
);
|
|
89
|
-
console.log(
|
|
90
|
-
" " +
|
|
91
|
-
chalk.strikethrough.dim("run") +
|
|
92
|
-
" " +
|
|
93
|
-
chalk.strikethrough.bold.blue("--snapshot") +
|
|
94
|
-
" " +
|
|
95
|
-
"Take a snapshot of the tests",
|
|
96
|
-
);
|
|
97
|
-
console.log(
|
|
98
|
-
" " +
|
|
99
|
-
chalk.strikethrough.dim("use") +
|
|
100
|
-
" " +
|
|
101
|
-
chalk.strikethrough.bold.blue("--list") +
|
|
102
|
-
" " +
|
|
103
|
-
"List supported runtimes",
|
|
104
|
-
);
|
|
105
|
-
console.log(
|
|
106
|
-
" " +
|
|
107
|
-
chalk.strikethrough.dim("reporter") +
|
|
108
|
-
" " +
|
|
109
|
-
chalk.strikethrough.bold.blue("--list") +
|
|
110
|
-
" " +
|
|
111
|
-
"List supported reporters",
|
|
112
|
-
);
|
|
113
|
-
console.log(
|
|
114
|
-
" " +
|
|
115
|
-
chalk.strikethrough.dim("<command>") +
|
|
116
|
-
" " +
|
|
117
|
-
chalk.strikethrough.bold.blue("--help") +
|
|
118
|
-
" " +
|
|
119
|
-
"Print info about command" +
|
|
120
|
-
"\n",
|
|
121
|
-
);
|
|
122
|
-
console.log(
|
|
123
|
-
chalk.dim(
|
|
124
|
-
"If your using this, consider dropping a star, it would help a lot!",
|
|
125
|
-
) + "\n",
|
|
126
|
-
);
|
|
127
|
-
console.log(
|
|
128
|
-
"View the repo: " +
|
|
129
|
-
chalk.magenta("https://github.com/JairusSW/as-test"),
|
|
130
|
-
);
|
|
131
|
-
console.log(
|
|
132
|
-
"View the docs: " +
|
|
133
|
-
chalk.strikethrough.blue("https://docs.jairus.dev/as-test"),
|
|
134
|
-
);
|
|
135
|
-
}
|
package/bin/package.json
DELETED