Skip to content

Instantly share code, notes, and snippets.

View vitalets's full-sized avatar

Vitaliy Potapov vitalets

View GitHub Profile
@vitalets
vitalets / webpack.config.js
Created December 6, 2017 14:08
Mocha ES6 modules: webpack config v2
module.exports = {
entry: ['./setup.js', './run.js'],
output: {
filename: 'bundle.js',
},
resolve: {
alias: {
'https://unpkg.com/chai@4.1.2/chai.js': 'chai/chai.js'
}
}
@vitalets
vitalets / index.html
Created December 6, 2017 13:40
Mocha ES6 modules: index.html with fallback
<html>
<head>
<meta charset="utf-8">
<title>Mocha Tests</title>
<link href="https://unpkg.com/mocha@4.0.1/mocha.css" rel="stylesheet" />
<script src="https://unpkg.com/mocha@4.0.1/mocha.js"></script>
</head>
<body>
<div id="mocha"></div>
<script type="module" src="setup.js"></script>
@vitalets
vitalets / webpack.config.js
Created December 6, 2017 13:38
Mocha ES6 modules: webpack config v1
module.exports = {
entry: ['./setup.js', './run.js'],
output: {
filename: 'bundle.js',
}
};
@vitalets
vitalets / index.html
Created December 5, 2017 15:05
Mocha ES6 Modules
<html>
<head>
<meta charset="utf-8">
<title>Mocha Tests</title>
<link href="https://unpkg.com/mocha@4.0.1/mocha.css" rel="stylesheet" />
<script src="https://unpkg.com/mocha@4.0.1/mocha.js"></script>
</head>
<body>
<div id="mocha"></div>
<script type="module" src="setup.js"></script>
@vitalets
vitalets / run.js
Last active December 5, 2017 15:02
Mocha ES6 modules: correct run.js
import './sum.test.js';
mocha.checkLeaks();
mocha.run();
import 'https://unpkg.com/chai@4.1.2/chai.js';
mocha.setup('bdd');
import sum from './sum.js';
describe('sum', function () {
it('should return sum of arguments', function () {
chai.expect(sum(1, 2)).to.equal(3);
});
});
import 'https://unpkg.com/expect.js@0.3.1/index.js';
import 'https://unpkg.com/mocha@4.0.1/mocha.js';
mocha.setup('bdd');
import './sum.test.js';
mocha.checkLeaks();
mocha.run();
export default function sum(a, b) {
return a + b;
}
PASS src/isomorphic/classic/__tests__/ReactContextValidator-test.js
src/renderers/shared/shared/shouldUpdateReactComponent.js:26
Strict equal of different types: {"key":null,"ref":nu... (object) === false (boolean)
Strict equal of different types: [object Object] (object) === false (boolean)
src/renderers/shared/shared/shouldUpdateReactComponent.js:27
Strict equal of different types: {"key":null,"ref":nu... (object) === false (boolean)
Strict equal of different types: [object Object] (object) === false (boolean)
src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:1258