Commit b051c2b
authored
refactor(tests): modular mock-free test suite with cross-platform CI (#13)
* Extract three module globals into RuntimeSingletons container for atomic test swap
* Create centralized test harness with singleton isolation and capture
* Fragment monolithic test into per-module unit suites with snapshots
* Add test runner script, module loader bootstrap, and E2E suite
* Update package metadata, scripts, and contributing docs for test suite
* Enable cross-platform E2E tests (Windows, Linux, macOS)
- Remove the Windows exclusion guard from E2E test step in CI workflow
- The process-isolated child-process harness uses only cross-platform Node.js
APIs (spawn, readline, stdio pipes) and is verified to work on Windows
- Add .gitattributes to enforce LF line endings on snapshot golden files
- Add normalizeEOL() helper in snapshot tests for Windows CRLF handling
- Add E2E_TIMEOUT_MS env var support for configurable test timeouts
- Add engines.node >=22 to package.json
- Add tsconfig.json for type checking
- Update CI documentation in CONTRIBUTING.md
Closes #12
* Commit package-lock.json for reproducible CI installs
* Move type+audit checks into matrix rows, remove gate job
* chore: upgrade SDK peerDependencies to v0.78.1
* refactor(notebook): use TypeBox schemas for typed tool parameters
* refactor(notebook/rehydration): use CustomEntry generic type
* fix(spawn): widen message types for SDK v0.78.1 content union
* fix(spawn/renderer): add null-safety and type casts for SDK v0.78.1
* test: fix mocks and helpers for SDK v0.78.1 API surface
* test: fix spawn tests for SDK v0.78.1 type changes
* test: fix notebook tests for widened content access
* Rename PytestHarness to ProcessHarness
* Use real AbortSignal in mock test context
* Guard infinite loop in findPackageRoot with maxDepth
* Fix Node version comment for module.register availability
* Add missing-entry error test for register-loader
* Document single-active-harness lifecycle constraint
* Move render snapshots from __snapshots__ to tests/snapshots/
* Add try/catch recovery to SpawnFrameScheduler flush
* Tag noop scheduler with sentinel marker
* Update test harness lifecycle constraints comment
* Wrap property tests with harness isolation
* Split oversized spawn test file into focused modules
* Wrap runtime-singletons test with harness isolation
* Tighten assertions to test invariants instead of disjunctions
* Fix E2E mock: add model field for spawn ctx.model check
* Fix misleading JSDoc on __setSingletons
* Add isNoopScheduler with import-order guard in test harness
* Remove fragile spread pattern from snapshot test harness
* Preserve writeContext alongside writeLock during in-flight singleton swaps
* Add regression test for non-reentrant saveNotebookPage across singleton swaps
* Align peer dependency ranges with tested SDK baseline
* Convert pty-harness.ts and basic.test.ts to tab indentation
* Resolve TypeBox from project dependency tree via exports map
* Add regression tests for TypeBox resolution in register-loader1 parent 31f0b94 commit b051c2b
49 files changed
Lines changed: 9444 additions & 3945 deletions
File tree
- .github/workflows
- notebook
- scripts
- spawn
- tests
- e2e
- snapshots
- unit
- fixtures
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
| 145 | + | |
147 | 146 | | |
148 | 147 | | |
149 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
17 | | - | |
| 17 | + | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
41 | 65 | | |
42 | 66 | | |
43 | 67 | | |
| |||
0 commit comments