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.
Files changed (95) hide show
  1. package/BINARYEN_VERSION +1 -1
  2. package/README.md +10 -13
  3. package/assembly/compare.ts +453 -95
  4. package/assembly/expect.ts +113 -62
  5. package/assembly/index.ts +0 -10
  6. package/assembly/utils.ts +168 -0
  7. package/binding.gyp +4 -4
  8. package/dist/{addon-interface-_pNXcbib.mjs → addon-interface-CYFXMbK7.mjs} +4 -3
  9. package/dist/addon-interface-CYFXMbK7.mjs.map +1 -0
  10. package/dist/{ast-visitor-C5gQqWD2.mjs → ast-visitor-CWEOd3UH.mjs} +15 -2
  11. package/dist/ast-visitor-CWEOd3UH.mjs.map +1 -0
  12. package/dist/{compile-runner-DOMhsLQE.mjs → compile-runner-BNFHRGZO.mjs} +8 -7
  13. package/dist/compile-runner-BNFHRGZO.mjs.map +1 -0
  14. package/dist/compiler/transforms/deep-equals.d.mts +14 -0
  15. package/dist/compiler/transforms/deep-equals.d.mts.map +1 -0
  16. package/dist/compiler/transforms/deep-equals.mjs +245 -0
  17. package/dist/compiler/transforms/deep-equals.mjs.map +1 -0
  18. package/dist/compiler/transforms/strip-inline.mjs +2 -2
  19. package/dist/{compiler-CIXpfKq0.mjs → compiler-Dqs-qd3I.mjs} +18 -8
  20. package/dist/compiler-Dqs-qd3I.mjs.map +1 -0
  21. package/dist/config/index-v3.d.mts +33 -3
  22. package/dist/config/index-v3.d.mts.map +1 -1
  23. package/dist/config/index-v3.mjs.map +1 -1
  24. package/dist/config/index.d.mts +29 -4
  25. package/dist/config/index.d.mts.map +1 -0
  26. package/dist/config/index.mjs +6 -6
  27. package/dist/{constants-DuBLuMjt.mjs → constants-DbxJ3hzg.mjs} +10 -97
  28. package/dist/constants-DbxJ3hzg.mjs.map +1 -0
  29. package/dist/coverage-provider/index.mjs +30 -10
  30. package/dist/coverage-provider/index.mjs.map +1 -1
  31. package/dist/{debug-Cm1VFmaz.mjs → debug-DtRAL4rM.mjs} +38 -4
  32. package/dist/debug-DtRAL4rM.mjs.map +1 -0
  33. package/dist/{feature-check-ELxw_Mji.mjs → feature-check-Bje3ntpV.mjs} +2 -2
  34. package/dist/{feature-check-ELxw_Mji.mjs.map → feature-check-Bje3ntpV.mjs.map} +1 -1
  35. package/dist/index-internal.d.mts +1 -1
  36. package/dist/index-internal.d.mts.map +1 -1
  37. package/dist/index-internal.mjs +4 -4
  38. package/dist/index-v3.d.mts.map +1 -1
  39. package/dist/index-v3.mjs +8 -7
  40. package/dist/index-v3.mjs.map +1 -1
  41. package/dist/index.d.mts +1 -2
  42. package/dist/index.mjs +6 -6
  43. package/dist/{load-user-imports-B3Iy_K8k.mjs → load-user-imports-Bx5ZlhSm.mjs} +9 -9
  44. package/dist/load-user-imports-Bx5ZlhSm.mjs.map +1 -0
  45. package/dist/{pool-runner-init-BDQtAGwQ.mjs → pool-runner-init-BqkwQ2tk.mjs} +7 -7
  46. package/dist/pool-runner-init-BqkwQ2tk.mjs.map +1 -0
  47. package/dist/{pool-runner-init-CvnB0-iN.d.mts → pool-runner-init-CNpRdA5u.d.mts} +2 -2
  48. package/dist/pool-runner-init-CNpRdA5u.d.mts.map +1 -0
  49. package/dist/pool-thread/compile-worker-thread.d.mts +1 -1
  50. package/dist/pool-thread/compile-worker-thread.d.mts.map +1 -1
  51. package/dist/pool-thread/compile-worker-thread.mjs +10 -13
  52. package/dist/pool-thread/compile-worker-thread.mjs.map +1 -1
  53. package/dist/pool-thread/test-worker-thread.d.mts +1 -1
  54. package/dist/pool-thread/test-worker-thread.d.mts.map +1 -1
  55. package/dist/pool-thread/test-worker-thread.mjs +8 -11
  56. package/dist/pool-thread/test-worker-thread.mjs.map +1 -1
  57. package/dist/pool-thread/v3-tinypool-thread.d.mts +1 -1
  58. package/dist/pool-thread/v3-tinypool-thread.d.mts.map +1 -1
  59. package/dist/pool-thread/v3-tinypool-thread.mjs +12 -18
  60. package/dist/pool-thread/v3-tinypool-thread.mjs.map +1 -1
  61. package/dist/{resolve-config-DhZ4lOSK.mjs → resolve-config-s9gSJSMc.mjs} +14 -5
  62. package/dist/resolve-config-s9gSJSMc.mjs.map +1 -0
  63. package/dist/{test-runner-C4I9VknR.mjs → test-runner-BGqc9uCK.mjs} +4 -4
  64. package/dist/{test-runner-C4I9VknR.mjs.map → test-runner-BGqc9uCK.mjs.map} +1 -1
  65. package/dist/{types-D0nprJo1.d.mts → types-DHVk5iAx.d.mts} +17 -11
  66. package/dist/types-DHVk5iAx.d.mts.map +1 -0
  67. package/dist/vitest-file-tasks-D8sOClGX.mjs +149 -0
  68. package/dist/vitest-file-tasks-D8sOClGX.mjs.map +1 -0
  69. package/dist/{vitest-tasks--ow4pacR.mjs → vitest-tasks-BZ24sghI.mjs} +6 -4
  70. package/dist/vitest-tasks-BZ24sghI.mjs.map +1 -0
  71. package/package.json +11 -14
  72. package/prebuilds/darwin-arm64/vitest-pool-assemblyscript.glibc.node +0 -0
  73. package/prebuilds/darwin-x64/vitest-pool-assemblyscript.glibc.node +0 -0
  74. package/prebuilds/linux-arm64/vitest-pool-assemblyscript.glibc.node +0 -0
  75. package/prebuilds/linux-x64/vitest-pool-assemblyscript.glibc.node +0 -0
  76. package/prebuilds/linux-x64/vitest-pool-assemblyscript.musl.node +0 -0
  77. package/prebuilds/win32-arm64/vitest-pool-assemblyscript.glibc.node +0 -0
  78. package/prebuilds/win32-x64/vitest-pool-assemblyscript.glibc.node +0 -0
  79. package/src/instrumentation/native/addon.cpp +29 -3
  80. package/dist/addon-interface-_pNXcbib.mjs.map +0 -1
  81. package/dist/ast-visitor-C5gQqWD2.mjs.map +0 -1
  82. package/dist/compile-runner-DOMhsLQE.mjs.map +0 -1
  83. package/dist/compiler-CIXpfKq0.mjs.map +0 -1
  84. package/dist/constants-DuBLuMjt.mjs.map +0 -1
  85. package/dist/custom-provider-options-YTk1m7At.d.mts +0 -26
  86. package/dist/custom-provider-options-YTk1m7At.d.mts.map +0 -1
  87. package/dist/debug-Cm1VFmaz.mjs.map +0 -1
  88. package/dist/load-user-imports-B3Iy_K8k.mjs.map +0 -1
  89. package/dist/pool-runner-init-BDQtAGwQ.mjs.map +0 -1
  90. package/dist/pool-runner-init-CvnB0-iN.d.mts.map +0 -1
  91. package/dist/resolve-config-DhZ4lOSK.mjs.map +0 -1
  92. package/dist/types-D0nprJo1.d.mts.map +0 -1
  93. package/dist/vitest-file-tasks-Bn9CrWt_.mjs +0 -61
  94. package/dist/vitest-file-tasks-Bn9CrWt_.mjs.map +0 -1
  95. package/dist/vitest-tasks--ow4pacR.mjs.map +0 -1
package/BINARYEN_VERSION CHANGED
@@ -1 +1 @@
1
- version_124
1
+ version_129
package/README.md CHANGED
@@ -65,16 +65,16 @@
65
65
 
66
66
  ## Status
67
67
 
68
- This project is relatively new to the scene, but is stable and is being improved every day. Please give it a try!
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 ([please report any](https://github.com/themattspiral/vitest-pool-assemblyscript/issues/new)).
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/>- istanbul JS delegation coming soon
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 (delegating to v8 for JS/TS coverage)
164
- - Coverage reporting using any vitest reporter (`html`, `lcov`, `json`, etc)
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 once
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 be used to catch and expect specific errors (which trap and abort)
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` (with caveats*), `toStrictEqual`, `toBeGreaterThan`, `toBeGreaterThanOrEqual`, `toBeLessThan`, `toBeLessThanOrEqual`, `toHaveLength`, `toThrowError`, `toBeTruthy`, `toBeFalsy`, `toBeNull`, `toBeNullable`, `toBeNaN`
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 or endorsed by the vitest team, though we're grateful for their extensible architecture that makes projects like this possible, and the [other open-source projects](#prior-work) that provide vital functionality and reference architecture.
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