-
-
Notifications
You must be signed in to change notification settings - Fork 750
Expand file tree
/
Copy pathtodo_test.js
More file actions
43 lines (39 loc) · 1.55 KB
/
todo_test.js
File metadata and controls
43 lines (39 loc) · 1.55 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
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')
const codecept_dir = path.join(__dirname, '/../data/sandbox/configs/todo')
const codecept_run = `${runner} run --config ${codecept_dir}/codecept.conf.js `
describe('Todo', () => {
it('should skip test with todo', done => {
exec(`${codecept_run}`, (err, stdout) => {
stdout.should.include('S @todo')
stdout.should.include('S @todo without function')
stdout.should.not.include('todo test not passed')
stdout.should.include('✔ @NotTodo in')
assert(!err)
done()
})
})
it('should skip inject skipinfo to todo test', done => {
exec(`${codecept_run}`, (err, stdout) => {
stdout.should.include('test @todo was marked for todo with message: Test not implemented!')
stdout.should.include('test @todo without function was marked for todo with message: Test not implemented!')
stdout.should.not.include('test @NotTodo was marked for todo with message: Test not implemented!')
assert(!err)
done()
})
})
it('should correctly pass custom opts for todo test', done => {
exec(`${codecept_run}`, (err, stdout) => {
stdout.should.include('test @todo with opts was marked for todo with customOpts: "Custom options for todo"')
assert(!err)
done()
})
})
})