laced
v0.1.3
Published
Dynamic interconnected unit testing
Downloads
4
Readme
laced
Laced is a dynamic interconnected unit testing framework.
It connects your tests in a network, so they work together.
Early alpha
Disclaimer: interconnected tests are not available yet.
Why?
First, we want to make writing tests effortless. Interconnecting them will be built on top of that.
What's available?
You can generate your tests using a spec YAML file. Check the Usage section for more details.
I need this now!
We can prioritize your needs; email me.
I want to help!
Try laced, be opinionated, and stick it to the man. We also have a Contributing section.
Example
I rely heavily on examples. Hope this helps! We'll add new features to the example as well.
Example: nizarmah/laced-example.
Usage
Install
$ npm install --save-dev laced
Spec
Create a TS file, e.g. src/index.ts
.
function greet(name: string): string {
return `Hello, ${name}!`;
}
Create a Spec file, e.g. src/index.spec.yml
tests:
greet:
description: Greets
cases:
- description: Says hello to Stranger
parameters:
- Stranger
returns: Hello, Stranger!
[!TIP] Check the Spec file anatomy to learn more.
Gen
$ npx laced
Generated: src/index.laced.test.ts
[!TIP] Check
--help
to see all the options.$ npx laced --help
Run
If you're already using Jest, run your tests as usual.
Otherwise, check how to run typescript tests with jest.
$ npx jest
PASS src/run.laced.test.ts
greet
✓ Says hello to Stranger (1 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 0.823 s
Ran all test suites.
Documentation
Check the documentation for more details.
Contributing
We love contributions!
How to contribute
Just open an issue, tell us what you'd like to do.
We'll let you know if it's a good fit. Then, full send!
Development
This section is for contributors.
Setup
$ # install bun: https://bun.sh/docs/installation
$ bun install
Run
$ bun run laced && bun run test
Build
$ bun run build
[!CAUTION] Test builds on node Docker images.
Publish
$ bun run build && npm publish --access public # --dry-run