0.15.0 • Published 5 years ago

substance-test v0.15.0

Weekly downloads
12
License
MIT
Repository
github
Last release
5 years ago

substance-test

A test-suite based on tape.

Running tape tests in the Substance TestSuite

Install substance-test:

$ npm install --save-dev substance-test

Bundle 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.

0.15.0

5 years ago

0.13.3

5 years ago

0.14.0

5 years ago

0.13.2

5 years ago

0.13.1

5 years ago

0.13.0

5 years ago

0.12.6

5 years ago

0.12.5

5 years ago

0.12.4

5 years ago

0.12.3

6 years ago

0.12.2

6 years ago

0.12.1

6 years ago

0.12.0

6 years ago

0.11.0

6 years ago

0.9.5

6 years ago

0.9.4

7 years ago

0.10.0

7 years ago

0.9.3

7 years ago

0.9.2

7 years ago

0.9.1

7 years ago

0.9.0

7 years ago

0.8.4

7 years ago

0.8.3

7 years ago

0.8.2

7 years ago

0.8.0

7 years ago

0.7.1

7 years ago

0.7.0

7 years ago

0.6.6

7 years ago

0.6.5

7 years ago

0.6.4

7 years ago

0.6.3

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.5

7 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

8 years ago

0.2.6

8 years ago

0.2.5

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.3.0-1

10 years ago

0.3.0

10 years ago

0.2.0

11 years ago

0.2.0-alpha

11 years ago

0.1.0

11 years ago