This repository was archived by the owner on Jan 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.public.js
More file actions
57 lines (46 loc) · 1.95 KB
/
Copy pathtest.public.js
File metadata and controls
57 lines (46 loc) · 1.95 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
"use strict";
const expect = require("chai").expect;
const codecheck = require("codecheck");
const app = codecheck.consoleApp(process.env.APP_COMMAND);
// TODO: if you have any helper functions, declare them in the `lib` folder.
const helperFunction = require("./lib.js").helperFunction;
const prepareDataset = require("./lib.js").prepareDataset;
// TODO: all `{{}}` must be populated before the tests will run successfully.
// remember, a good test case suite fulfills the RISES mnemonic.
// (Readable, Independent, Small, Exhaustive, Speedy)
describe(`CLI`, () => {
let datasets = []
let prepareDatasets;
before(() => {
// all codecheck commands are run before they are `assert`ed.
// this is to improve the readability of console outputs.
// all results are returned in `datasets`.
// TODO: enter args below.
prepareDatasets = prepareDataset( datasets, ['{{arg1}}', '{{arg2}}'] )
.then( datasets => prepareDataset( datasets, ['{{arg1}}', '{{arg2}}'] ))
return prepareDatasets
});
// TODO: enter name of feature below. (ex: Memoizer)
describe(`{{feature}}`, () => {
// TODO: fill it() text with meaningful description of the expected behavior.
it(`outputs a non-empty string when {{description of condition}}`, () => {
return prepareDatasets.then( datasets => {
let result = datasets[{{args}}].result
expect(result.stdout).to.be.ok;
expect(result.stdout[0]).to.be.ok.and.a('string');
});
});
it(`outputs header in the expected format when {{description of condition}}`, () => {
return prepareDatasets.then( datasets => {
let result = datasets[{{args}}].result
let actualHeader = result.stdout[0].trim();
let expectedHeader = "Subject,Mean"
expect(actualHeader).to.equal(expectedHeader);
});
});
// {{more unique it()s here...}}
});
describe(`{{another feature}}`, () => {
// {{more unique it()s here...}}
});
});