Skip to content

Commit

Permalink
Patch up root.js
Browse files Browse the repository at this point in the history
  • Loading branch information
pletcher committed Aug 5, 2016
1 parent 83d1776 commit f9e67c9
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@ const babel = require('babel-core');
const jsdom = require('jsdom');
const path = require('path');


before(function(done) {
const babelResult = babel.transformFileSync(path.resolve(__dirname, '..', 'index.js'), {
const js = path.resolve(__dirname, '..', 'index.js');
const babelResult = babel.transformFileSync(js, {
presets: ['es2015']
});

const html = path.resolve(__dirname, '..', 'index.html')
const html = path.resolve(__dirname, '..', 'index.html');

jsdom.env(html, [], {
src: babelResult.code,
virtualConsole: jsdom.createVirtualConsole().sendTo(console)
}, (err, window) => {
global.window = window
if (err) {
return done(err);
}

global.window = window;

return done(err);
return done();
});
});

0 comments on commit f9e67c9

Please sign in to comment.