This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sum from './sum.js'; | |
describe('sum', function () { | |
it('should return sum of arguments', function () { | |
chai.expect(sum(1, 2)).to.equal(3); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'https://unpkg.com/chai@4.1.2/chai.js'; | |
mocha.setup('bdd'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import './sum.test.js'; | |
mocha.checkLeaks(); | |
mocha.run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
entry: ['./setup.js', './run.js'], | |
output: { | |
filename: 'bundle.js', | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
entry: ['./setup.js', './run.js'], | |
output: { | |
filename: 'bundle.js', | |
}, | |
resolve: { | |
alias: { | |
// map remote chai.js url to locally installed in node_modules | |
'https://unpkg.com/chai@4.1.2/chai.js': 'chai/chai.js' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('sum', function () { | |
it('should return sum of arguments', function () { | |
chai.expect(sum(1, 2)).to.equal(3); | |
}); | |
}); |