vitest-pool-assemblyscript 0.8.0 → 0.9.1
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/BINARYEN_VERSION +1 -1
- package/README.md +10 -13
- package/assembly/compare.ts +453 -95
- package/assembly/expect.ts +113 -62
- package/assembly/index.ts +0 -10
- package/assembly/utils.ts +168 -0
- package/binding.gyp +4 -4
- package/dist/{addon-interface-_pNXcbib.mjs → addon-interface-CYFXMbK7.mjs} +4 -3
- package/dist/addon-interface-CYFXMbK7.mjs.map +1 -0
- package/dist/{ast-visitor-C5gQqWD2.mjs → ast-visitor-CWEOd3UH.mjs} +15 -2
- package/dist/ast-visitor-CWEOd3UH.mjs.map +1 -0
- package/dist/{compile-runner-DOMhsLQE.mjs → compile-runner-BNFHRGZO.mjs} +8 -7
- package/dist/compile-runner-BNFHRGZO.mjs.map +1 -0
- package/dist/compiler/transforms/deep-equals.d.mts +14 -0
- package/dist/compiler/transforms/deep-equals.d.mts.map +1 -0
- package/dist/compiler/transforms/deep-equals.mjs +245 -0
- package/dist/compiler/transforms/deep-equals.mjs.map +1 -0
- package/dist/compiler/transforms/strip-inline.mjs +2 -2
- package/dist/{compiler-CIXpfKq0.mjs → compiler-Dqs-qd3I.mjs} +18 -8
- package/dist/compiler-Dqs-qd3I.mjs.map +1 -0
- package/dist/config/index-v3.d.mts +33 -3
- package/dist/config/index-v3.d.mts.map +1 -1
- package/dist/config/index-v3.mjs.map +1 -1
- package/dist/config/index.d.mts +29 -4
- package/dist/config/index.d.mts.map +1 -0
- package/dist/config/index.mjs +6 -6
- package/dist/{constants-DuBLuMjt.mjs → constants-DbxJ3hzg.mjs} +10 -97
- package/dist/constants-DbxJ3hzg.mjs.map +1 -0
- package/dist/coverage-provider/index.mjs +30 -10
- package/dist/coverage-provider/index.mjs.map +1 -1
- package/dist/{debug-Cm1VFmaz.mjs → debug-DtRAL4rM.mjs} +38 -4
- package/dist/debug-DtRAL4rM.mjs.map +1 -0
- package/dist/{feature-check-ELxw_Mji.mjs → feature-check-Bje3ntpV.mjs} +2 -2
- package/dist/{feature-check-ELxw_Mji.mjs.map → feature-check-Bje3ntpV.mjs.map} +1 -1
- package/dist/index-internal.d.mts +1 -1
- package/dist/index-internal.d.mts.map +1 -1
- package/dist/index-internal.mjs +4 -4
- package/dist/index-v3.d.mts.map +1 -1
- package/dist/index-v3.mjs +8 -7
- package/dist/index-v3.mjs.map +1 -1
- package/dist/index.d.mts +1 -2
- package/dist/index.mjs +6 -6
- package/dist/{load-user-imports-B3Iy_K8k.mjs → load-user-imports-Bx5ZlhSm.mjs} +9 -9
- package/dist/load-user-imports-Bx5ZlhSm.mjs.map +1 -0
- package/dist/{pool-runner-init-BDQtAGwQ.mjs → pool-runner-init-BqkwQ2tk.mjs} +7 -7
- package/dist/pool-runner-init-BqkwQ2tk.mjs.map +1 -0
- package/dist/{pool-runner-init-CvnB0-iN.d.mts → pool-runner-init-CNpRdA5u.d.mts} +2 -2
- package/dist/pool-runner-init-CNpRdA5u.d.mts.map +1 -0
- package/dist/pool-thread/compile-worker-thread.d.mts +1 -1
- package/dist/pool-thread/compile-worker-thread.d.mts.map +1 -1
- package/dist/pool-thread/compile-worker-thread.mjs +10 -13
- package/dist/pool-thread/compile-worker-thread.mjs.map +1 -1
- package/dist/pool-thread/test-worker-thread.d.mts +1 -1
- package/dist/pool-thread/test-worker-thread.d.mts.map +1 -1
- package/dist/pool-thread/test-worker-thread.mjs +8 -11
- package/dist/pool-thread/test-worker-thread.mjs.map +1 -1
- package/dist/pool-thread/v3-tinypool-thread.d.mts +1 -1
- package/dist/pool-thread/v3-tinypool-thread.d.mts.map +1 -1
- package/dist/pool-thread/v3-tinypool-thread.mjs +12 -18
- package/dist/pool-thread/v3-tinypool-thread.mjs.map +1 -1
- package/dist/{resolve-config-DhZ4lOSK.mjs → resolve-config-s9gSJSMc.mjs} +14 -5
- package/dist/resolve-config-s9gSJSMc.mjs.map +1 -0
- package/dist/{test-runner-C4I9VknR.mjs → test-runner-BGqc9uCK.mjs} +4 -4
- package/dist/{test-runner-C4I9VknR.mjs.map → test-runner-BGqc9uCK.mjs.map} +1 -1
- package/dist/{types-D0nprJo1.d.mts → types-DHVk5iAx.d.mts} +17 -11
- package/dist/types-DHVk5iAx.d.mts.map +1 -0
- package/dist/vitest-file-tasks-D8sOClGX.mjs +149 -0
- package/dist/vitest-file-tasks-D8sOClGX.mjs.map +1 -0
- package/dist/{vitest-tasks--ow4pacR.mjs → vitest-tasks-BZ24sghI.mjs} +6 -4
- package/dist/vitest-tasks-BZ24sghI.mjs.map +1 -0
- package/package.json +11 -14
- package/prebuilds/darwin-arm64/vitest-pool-assemblyscript.glibc.node +0 -0
- package/prebuilds/darwin-x64/vitest-pool-assemblyscript.glibc.node +0 -0
- package/prebuilds/linux-arm64/vitest-pool-assemblyscript.glibc.node +0 -0
- package/prebuilds/linux-x64/vitest-pool-assemblyscript.glibc.node +0 -0
- package/prebuilds/linux-x64/vitest-pool-assemblyscript.musl.node +0 -0
- package/prebuilds/win32-arm64/vitest-pool-assemblyscript.glibc.node +0 -0
- package/prebuilds/win32-x64/vitest-pool-assemblyscript.glibc.node +0 -0
- package/src/instrumentation/native/addon.cpp +29 -3
- package/dist/addon-interface-_pNXcbib.mjs.map +0 -1
- package/dist/ast-visitor-C5gQqWD2.mjs.map +0 -1
- package/dist/compile-runner-DOMhsLQE.mjs.map +0 -1
- package/dist/compiler-CIXpfKq0.mjs.map +0 -1
- package/dist/constants-DuBLuMjt.mjs.map +0 -1
- package/dist/custom-provider-options-YTk1m7At.d.mts +0 -26
- package/dist/custom-provider-options-YTk1m7At.d.mts.map +0 -1
- package/dist/debug-Cm1VFmaz.mjs.map +0 -1
- package/dist/load-user-imports-B3Iy_K8k.mjs.map +0 -1
- package/dist/pool-runner-init-BDQtAGwQ.mjs.map +0 -1
- package/dist/pool-runner-init-CvnB0-iN.d.mts.map +0 -1
- package/dist/resolve-config-DhZ4lOSK.mjs.map +0 -1
- package/dist/types-D0nprJo1.d.mts.map +0 -1
- package/dist/vitest-file-tasks-Bn9CrWt_.mjs +0 -61
- package/dist/vitest-file-tasks-Bn9CrWt_.mjs.map +0 -1
- package/dist/vitest-tasks--ow4pacR.mjs.map +0 -1
package/BINARYEN_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
version_129
|
package/README.md
CHANGED
|
@@ -65,16 +65,16 @@
|
|
|
65
65
|
|
|
66
66
|
## Status
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
While relatively young, this project is stable and is being improved every day.
|
|
69
69
|
|
|
70
|
-
All [listed features](#features) are working and assumed to be bug-free
|
|
70
|
+
All [listed features](#features) are working, tested, and assumed to be bug-free.
|
|
71
71
|
|
|
72
72
|
| Item | Status |
|
|
73
73
|
|---|---|
|
|
74
74
|
| [`describe()` and `test()` APIs](#writing-tests) | - stable<br/>- no breaking changes expected |
|
|
75
75
|
| [`expect()` API](docs/matchers-api.md) | - stable<br/>- no breaking changes expected<br/>- more matchers coming soon |
|
|
76
76
|
| Code Coverage / Instrumentation | - function coverage stable [across platforms](#compatibility)<br/>- branch & line coverage coming soon |
|
|
77
|
-
| Hybrid Coverage Provider | - stable<br/>- v8 JS delegation, side-by-side JS coverage<br/>-
|
|
77
|
+
| Hybrid Coverage Provider | - stable<br/>- v8 JS delegation, side-by-side JS coverage<br/>- JS delegation to istanbul provider coming soon
|
|
78
78
|
|
|
79
79
|
See Also:
|
|
80
80
|
- [Current Limitations & Roadmap](#current-limitations--roadmap)
|
|
@@ -160,21 +160,20 @@ npx vitest run
|
|
|
160
160
|
- Use familiar `vitest` commands, CLI spec and test filtering, watch mode
|
|
161
161
|
- Works with Vitest UI, reporters, and coverage tools
|
|
162
162
|
- Project (workspace) config allows coexisting AssemblyScript pools and JavaScript pools
|
|
163
|
-
- Hybrid Coverage Provider unifies test reports from multiple pools (
|
|
164
|
-
-
|
|
165
|
-
- Dual vitest 3.x / 4.x support
|
|
163
|
+
- Hybrid Coverage Provider unifies test reports (`html`, `lcov`, `json`, etc) from multiple pools (delegates to v8 provider for JS coverage)
|
|
164
|
+
- Supports vitest 3.x and 4.x
|
|
166
165
|
|
|
167
166
|
### Per-Test WASM Isolation
|
|
168
|
-
- Each AssemblyScript test file is compiled to a WASM binary
|
|
169
|
-
- Each test case runs in a fresh WASM instance (reusing the compiled binary)
|
|
167
|
+
- Each AssemblyScript test **file** is compiled to a WASM binary
|
|
168
|
+
- Each AssemblyScript test **case** runs in a fresh WASM instance (reusing the compiled binary)
|
|
170
169
|
- One crashing test doesn't kill the rest within the same suite
|
|
171
|
-
- `toThrowError()` matcher can
|
|
170
|
+
- `toThrowError()` matcher can catch and expect specific errors (which trap and abort)
|
|
172
171
|
|
|
173
172
|
### Familiar Developer Experience
|
|
174
173
|
- Suite and test definition using `describe()` and `test()` in AssemblyScript
|
|
175
174
|
- Inline test option configuration for common vitest options: `timeout`, `retry`, `skip`, `only`, `fails`
|
|
176
175
|
- Assertion matching API based on vitest/jest `expect()` API
|
|
177
|
-
- `.not`, `toBe`, `toBeCloseTo`, `toEqual
|
|
176
|
+
- `.not`, `toBe`, `toBeCloseTo`, `toEqual`, `toStrictEqual`, `toBeGreaterThan`, `toBeGreaterThanOrEqual`, `toBeLessThan`, `toBeLessThanOrEqual`, `toHaveLength`, `toThrowError`, `toBeTruthy`, `toBeFalsy`, `toBeNull`, `toBeNullable`, `toBeNaN`
|
|
178
177
|
- See [Matchers API](docs/matchers-api.md) for details and differences from JavaScript
|
|
179
178
|
- Highlighted diffs for assertion and runtime failures, which point to source code
|
|
180
179
|
- Source-mapped WASM error stack traces (accurate AssemblyScript source `function file:line:column`)
|
|
@@ -265,7 +264,7 @@ The overall goal is tight vitest experience integration - most CLI commands, rep
|
|
|
265
264
|
|
|
266
265
|
**Q: Is this an official vitest project?**
|
|
267
266
|
<br/>
|
|
268
|
-
**A:** No, this is a third-party community project. It's not affiliated with
|
|
267
|
+
**A:** No, this is a third-party, community project. It's not affiliated with the Vitest team or VoidZero directly, though we're grateful for their open-source code and intentionally extensible architecture which make projects like this possible, and to the [other open-source projects](#prior-work) that provide vital functionality and reference architecture.
|
|
269
268
|
|
|
270
269
|
**Q: Are you a company? A bot?**
|
|
271
270
|
<br/>
|
|
@@ -406,7 +405,6 @@ These are known limitations which are currently being worked on.
|
|
|
406
405
|
- **Function-level coverage only**: No statement, branch, or line coverage yet
|
|
407
406
|
- **No lifecycle hooks**: No setup/teardown hooks yet
|
|
408
407
|
- **Watch mode handles specs only**: Re-runs test files when they are directly changed, but not yet based on changed source files
|
|
409
|
-
- **`toEqual` doesn't reflect**: Doesn't yet support deep inspection of user-defined objects
|
|
410
408
|
|
|
411
409
|
### Near Future Roadmap
|
|
412
410
|
|
|
@@ -418,7 +416,6 @@ These are known limitations which are currently being worked on.
|
|
|
418
416
|
**Epic: Testing DX**
|
|
419
417
|
- Lifecycle hooks (`beforeEach`, `afterEach`, `beforeAll`, `afterAll`)
|
|
420
418
|
- Watch mode: re-run applicable tests on source file changes
|
|
421
|
-
- `toEqual` reflection for deep equality inspection of user objects
|
|
422
419
|
- `describe.for/each` and `test.for/each`
|
|
423
420
|
- expect.soft to prevent fail-fast behavior
|
|
424
421
|
- Allow delegating JS/TS to istanbul coverage provider in addition to v8
|