Last active
November 20, 2018 08:19
-
-
Save imaman/0c428ccc0eac32b76f493fcaa7985571 to your computer and use it in GitHub Desktop.
ts unit testing boilerplate
This file contains hidden or 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
| npm install --save-dev mocha ts-node chai chai-subset @types/chai @types/mocha @types/chai-subset | |
| cp /dev/stdin src/u.test.ts <<EOF | |
| import * as chai from 'chai'; | |
| import chaiSubset = require('chai-subset'); | |
| chai.use(chaiSubset); | |
| const {expect} = chai; | |
| import 'mocha'; | |
| describe('a', () => { | |
| it('is doing something', () => { | |
| expect(4 + 8).to.equal(12); | |
| }); | |
| }); | |
| EOF | |
| package.json > scripts: | |
| "unit": "mocha -r ts-node/register src/**/*.test.ts" | |
| https://github.com/testimio/data-platform/commit/611822d40ef84561d37fe844b53821bba7753482 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment