forked from misanorot/ioBroker.alarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.test.js
30 lines (23 loc) · 818 Bytes
/
main.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
'use strict';
/**
* This is a dummy TypeScript test file using chai and mocha
*
* It's automatically excluded from npm and its build output is excluded from both git and npm.
* It is advised to test all your modules with accompanying *.test.js-files
*/
// tslint:disable:no-unused-expression
const { expect } = require('chai');
// import { functionToTest } from "./moduleToTest";
describe('module to test => function to test', () => {
// initializing logic
const expected = 5;
it(`should return ${expected}`, () => {
const result = 5;
// assign result a value from functionToTest
expect(result).to.equal(expected);
// or using the should() syntax
result.should.equal(expected);
});
// ... more tests => it
});
// ... more test suites => describe