Skip to content

Instantly share code, notes, and snippets.

@kentaro-m
Created July 8, 2017 14:53
Show Gist options
  • Save kentaro-m/592543cdbad15efa71f2ca4c3a6bd5c0 to your computer and use it in GitHub Desktop.
Save kentaro-m/592543cdbad15efa71f2ca4c3a6bd5c0 to your computer and use it in GitHub Desktop.
Test runner for Atom package test using mocha
import { allowUnsafeEval, allowUnsafeNewFunction } from 'loophole';
const { createRunner } = allowUnsafeEval(() => {
return allowUnsafeNewFunction(() => {
return require('atom-mocha-test-runner');
});
});
const chai = allowUnsafeEval(() => {
return allowUnsafeNewFunction(() => {
return require('chai');
});
});
import chaiAsPromised from 'chai-as-promised';
chai.use(chaiAsPromised);
global.assert = chai.assert;
module.exports = createRunner({ testSuffixes: ['test.js'], reporter: 'spec' });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment