How to use the testem function in testem

To help you get started, we’ve selected a few testem examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alekseykulikov / browserify-test / src / index.js View on Github external
export default function ({ files, entries, transform, transforms, plugins, watch, browserifyOptions, testemOptions, finalizer }) {
  if (!files && entries) files = entries
  if (!files || !files.length) throw new Error('specify files')
  if (!transform && transforms) transform = transforms

  // setup testem & browserify

  const testem = new Testem()
  const config = Object.assign({
    framework: 'mocha',
    launch_in_ci: ['phantomjs'],
    launch_in_dev: ['phantomjs']
  }, testemOptions)

  let b
  if (watch) {
    testem.startDev(config, finalizer)
    b = watchify(browserify(files, Object.assign(watchify.args, browserifyOptions)))
    b.on('update', () => testem.app.runTests()) // reload
  } else {
    testem.startCI(config, finalizer)
    b = browserify(files, browserifyOptions)
  }

testem

Test'em 'scripts! Javascript Unit testing made easy.

MIT
Latest version published 3 days ago

Package Health Score

89 / 100
Full package analysis