-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1459058
commit b275392
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
``` |