Skip to content

Commit 51a72ae

Browse files
committedJul 29, 2016
Update tests again
1 parent f36f829 commit 51a72ae

File tree

5 files changed

+28
-13502
lines changed

5 files changed

+28
-13502
lines changed
 

‎index.html

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Round and round and round and round</title>
5+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<link rel="stylesheet" href="node_modules/mocha/mocha.css" />
8+
</head>
9+
<body>
10+
<div id="mocha"></div>
11+
<script src="node_modules/mocha/mocha.js"></script>
12+
<script src="node_modules/expect/umd/expect.min.js"></script>
13+
<script>mocha.setup('bdd');</script>
14+
<script src="index.js"></script>
15+
<script src="test/index-test.js"></script>
16+
<script>
17+
mocha.run();
18+
</script>
19+
</body>
20+
</html>

‎test/index-test.html

-20
This file was deleted.

‎test/mocha.css

-314
This file was deleted.

‎test/mocha.js

-13,149
This file was deleted.

‎test/root.js

+8-19
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
11
global.expect = require('expect');
22

33
const babel = require('babel-core');
4-
const jsdom = require('jsdom');
4+
const jsdom = require('mocha-jsdom');
55
const path = require('path');
66

7-
8-
before(function(done) {
9-
const babelResult = babel.transformFileSync(path.resolve(__dirname, '..', 'index.js'), {
7+
const babelResult = babel.transformFileSync(
8+
path.resolve(__dirname, '..', 'index.js'), {
109
presets: ['es2015']
11-
});
12-
13-
//const src = path.resolve(__dirname, '..', 'index.js');
14-
15-
jsdom.env('<div></div>', [], {src: babelResult.code}, (err, window) => {
16-
if (err) {
17-
return done(err);
18-
}
19-
20-
Object.keys(window).forEach(key => {
21-
global[key] = window[key];
22-
});
10+
}
11+
);
2312

24-
return done();
25-
});
26-
});
13+
jsdom({
14+
src: babelResult.code
15+
});

0 commit comments

Comments
 (0)
Please sign in to comment.