-
-
Notifications
You must be signed in to change notification settings - Fork 750
Expand file tree
/
Copy pathhelp_test.js
More file actions
42 lines (38 loc) · 1.15 KB
/
help_test.js
File metadata and controls
42 lines (38 loc) · 1.15 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
import * as chai from 'chai';
chai.should();
import assert from 'assert';
import path from 'path';
import { exec } from 'child_process';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const runner = path.join(__dirname, '/../../bin/codecept.js')
describe('help option', () => {
it('should print help message with --help option', done => {
exec(`${runner} --help`, (err, stdout) => {
stdout.should.include('Usage:')
stdout.should.include('Options:')
stdout.should.include('Commands:')
assert(!err)
done()
})
})
it('should print help message with -h option', done => {
exec(`${runner} -h`, (err, stdout) => {
stdout.should.include('Usage:')
stdout.should.include('Options:')
stdout.should.include('Commands:')
assert(!err)
done()
})
})
it('should print help message with no option', done => {
exec(`${runner}`, (err, stdout) => {
stdout.should.include('Usage:')
stdout.should.include('Options:')
stdout.should.include('Commands:')
assert(!err)
done()
})
})
})