Getting started with Intern 4

Benefits of Intern 4

No loader configuration

Consistent test runner

Extension points

Programmatic interface

import Node from 'intern/lib/executors/Node';

// Instantiate the executor and assign it to the `intern` global
const intern = global.intern = new Node();

// Configure the executor
intern.configure({
suites: './_tests/**/*.js'
});

// A simple reporter
intern.on('testEnd', test => {
if (test.passed) {
console.log(`+ ${test.id}`);
}
else if (test.skipped) {
console.log(`~ ${test.id}`);
}
else {
console.log(`- ${test.id}`);
}
});

// Run intern, exiting the script with a non-zero exit code if Intern has an error
intern.run().catch(error => {
process.exit(-1);
});

Intern 4 tutorial

  • Installation
  • Configuration
  • Unit testing
  • Functional testing
  • Code coverage analysis
  • Remote testing

Getting Help With Intern

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
SitePen

SitePen

Modernizing Apps, Tools & Teams | sitepen.com | Twitter: @sitepen