diff options
| author | mokha <mokha@cisco.com> | 2018-09-30 10:59:23 -0600 |
|---|---|---|
| committer | mokha <mokha@cisco.com> | 2018-09-30 10:59:23 -0600 |
| commit | e35713fc7a484bfff8ee758857239ae5c8dc9ee9 (patch) | |
| tree | 7c7533b0df0e00bdf84f3e5264778dd8fa214a4d /tests | |
| parent | 34dbdff61d335d7300bb1b5d8482e2de51f09d43 (diff) | |
install karma
* https://survivejs.com/webpack/techniques/testing/
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/add.js | 1 | ||||
| -rw-r--r-- | tests/add.test.js | 8 | ||||
| -rw-r--r-- | tests/index.js | 4 |
3 files changed, 13 insertions, 0 deletions
diff --git a/tests/add.js b/tests/add.js new file mode 100644 index 0000000..bf90601 --- /dev/null +++ b/tests/add.js @@ -0,0 +1 @@ +module.exports = (a, b) => a + b; diff --git a/tests/add.test.js b/tests/add.test.js new file mode 100644 index 0000000..1463362 --- /dev/null +++ b/tests/add.test.js @@ -0,0 +1,8 @@ +const assert = require('assert'); +const add = require('./add'); + +describe("Demo", () => { + it("should add correctly", () => { + assert.equal(add(1, 1), 2); + }); +}); diff --git a/tests/index.js b/tests/index.js new file mode 100644 index 0000000..67253fa --- /dev/null +++ b/tests/index.js @@ -0,0 +1,4 @@ +if (module.host) { + const context = require.context("mocha-loader!./", false, /\.test.js$/); + context.keys().forEach(context); +} |
