substance-test v0.15.0
substance-test
A test-suite based on tape.
Running tape tests in the Substance TestSuite
Install substance-test:
$ npm install --save-dev substance-testBundle your tests using rollup:
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>
<head>
<title>My TestSuite</title>
<link href='node_modules/substance-test/dist/test.css' rel='stylesheet' type='text/css'/>
<script type="text/javascript" src="node_modules/substance-test/dist/testsuite.js"></script>
<script type="text/javascript" src="dist/tests.js"></script>
</head>
</html>Then open this file in your browser.
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
12 years ago
12 years ago
12 years ago
13 years ago
13 years ago