0.15.0 • Published 7 years ago

substance-test v0.15.0

Weekly downloads
12
License
MIT
Repository
github
Last release
7 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

7 years ago

0.13.3

7 years ago

0.14.0

7 years ago

0.13.2

7 years ago

0.13.1

7 years ago

0.13.0

7 years ago

0.12.6

7 years ago

0.12.5

7 years ago

0.12.4

7 years ago

0.12.3

8 years ago

0.12.2

8 years ago

0.12.1

8 years ago

0.12.0

8 years ago

0.11.0

8 years ago

0.9.5

8 years ago

0.9.4

9 years ago

0.10.0

9 years ago

0.9.3

9 years ago

0.9.2

9 years ago

0.9.1

9 years ago

0.9.0

9 years ago

0.8.4

9 years ago

0.8.3

9 years ago

0.8.2

9 years ago

0.8.0

9 years ago

0.7.1

9 years ago

0.7.0

9 years ago

0.6.6

9 years ago

0.6.5

9 years ago

0.6.4

9 years ago

0.6.3

9 years ago

0.6.2

9 years ago

0.6.1

9 years ago

0.6.0

9 years ago

0.5.2

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.4.5

9 years ago

0.4.4

9 years ago

0.4.3

9 years ago

0.4.2

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.3

9 years ago

0.3.2

9 years ago

0.3.1

10 years ago

0.2.6

10 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.3.0-1

12 years ago

0.3.0

12 years ago

0.2.0

13 years ago

0.2.0-alpha

13 years ago

0.1.0

13 years ago