Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/substance/test
Substance testing facility.
https://github.com/substance/test
Last synced: about 2 months ago
JSON representation
Substance testing facility.
- Host: GitHub
- URL: https://github.com/substance/test
- Owner: substance
- Created: 2013-03-29T17:37:56.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2019-10-16T14:07:53.000Z (about 5 years ago)
- Last Synced: 2024-10-25T08:50:21.580Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 93.8 KB
- Stars: 5
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# substance-test
A test-suite based on [tape](https://github.com/substack/tape).
# Running tape tests in the Substance TestSuite
Install `substance-test`:
```sh
$ npm install --save-dev substance-test
```Bundle your tests using `rollup`:
```js
var glob = require('glob');
var rollup = require('rollup');
var hypothetical = require('rollup-plugin-hypothetical')// Create an index file for all tests
let index = glob.sync('test/*.js').map((f) => {
return `import './${f}'`
}).join('\n');
rollup.rollup({
entry: 'index.js',
plugins: [
hypothetical({
files: {
'index.js': index
},
allowRealFiles: true
}),
],
// let rollup skip tape
external: ['tape'],
}).then((bundle) => {
bundle.write({
format: 'umd', moduleName: 'tests',
dest: 'dist/tests.js',
globals: {
// instead of using tape directly
// we want to use the one managed by the test suite
tape: 'substanceTest.test'
}
})
})
```Create an HTML file like the following:
```html
My TestSuite
```
Then open this file in your browser.