Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tripolskypetr/worker-testbed
A worker-threads based test framework using Node.js, tape, and functools-kit, enabling parallel execution of isolated test cases. The main thread registers and spawns worker threads for each test, while the workers retrieve and execute tests, reporting results back via parentPort. This approach enhances test isolation
https://github.com/tripolskypetr/worker-testbed
isolation jest nodejs tape tdd testbed worker-threads
Last synced: 28 days ago
JSON representation
A worker-threads based test framework using Node.js, tape, and functools-kit, enabling parallel execution of isolated test cases. The main thread registers and spawns worker threads for each test, while the workers retrieve and execute tests, reporting results back via parentPort. This approach enhances test isolation
- Host: GitHub
- URL: https://github.com/tripolskypetr/worker-testbed
- Owner: tripolskypetr
- License: mit
- Created: 2025-01-16T16:30:30.000Z (29 days ago)
- Default Branch: master
- Last Pushed: 2025-01-16T18:38:25.000Z (29 days ago)
- Last Synced: 2025-01-16T19:15:01.532Z (28 days ago)
- Topics: isolation, jest, nodejs, tape, tdd, testbed, worker-threads
- Language: TypeScript
- Homepage: https://github.com/react-declarative/react-declarative
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# worker-testbed
> The AI-ready testbed which use Worker Threads to create isolated vm context
A worker-threads based test framework using `Node.js`, `tape`, and `functools-kit`, enabling parallel execution of isolated test cases. The main thread registers and spawns worker threads for each test, while the workers retrieve and execute tests, reporting results back via parentPort. This approach enhances test isolation, concurrency, and performance.
## Usage
```tsx
import { run, test } from 'worker-testbed';test("Will pass after three seconds", (t) => {
globalThis.test = {};
globalThis.test.foo = "bar";
setTimeout(() => {
t.pass(globalThis.test.foo);
}, 3_000);
})test("Will fail after a second cause globalThis.test is undefined", (t) => {
setTimeout(() => {
t.pass(globalThis.test.foo);
}, 1_000);
})run(import.meta.url)
```