Skip to content

Commit

Permalink
docs: add README
Browse files Browse the repository at this point in the history
  • Loading branch information
ph-fritsche committed Dec 25, 2023
1 parent 1459058 commit b275392
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Toolbox

Collection of loosely coupled units for testing libraries in multiple environments.

## Usage

Each unit is designed to be replaceable if your project or environment requires a different setup.
For the "default" usage there are setup functions that reduce the boilerplate.

```js
import { setupSourceModuleLoader, setupToolboxTester, setupNodeConductor, setupChromeConductor, serveDir } from '@ph.fritsche/toolbox'

const tester = await setupToolboxTester(
[ // Watched files
'src',
'test'
],
[ // Test coductors
setupNodeConductor('Node, Dependency version X', [
new URL('http://path/to/setup/fileX.js'),
]),
setupNodeConductor('Node, Dependency version Y', [
new URL('http://path/to/setup/fileY.js'),
]),
setupChromeConductor('Chrome, Dependency version X', [
new URL('http://path/to/setup/fileX.js'),
]),
],
[ // Loaders which e.g. transform TS to JS
await setupSourceModuleLoader()
],
)

// Run the tests with each of the conductors and report combined results
await tester.start()
```

0 comments on commit b275392

Please sign in to comment.