@@ -9,89 +9,80 @@ const config_run_config = (config, grep, verbose = false) => `${codecept_run} ${
9
9
describe ( 'CodeceptJS Timeouts' , function ( ) {
10
10
this . timeout ( 10000 ) ;
11
11
12
- it ( 'should stop test when timeout exceeded' , ( done ) => {
12
+ it ( 'should stop test when timeout exceeded' , ( ) => {
13
13
exec ( config_run_config ( 'codecept.conf.js' , 'timed out' ) , ( err , stdout ) => {
14
14
console . log ( stdout ) ;
15
15
expect ( stdout ) . toContain ( 'Timeout 2s exceeded' ) ;
16
16
expect ( stdout ) . toContain ( 'Timeout 1s exceeded' ) ;
17
17
expect ( err ) . toBeTruthy ( ) ;
18
- done ( ) ;
19
18
} ) ;
20
19
} ) ;
21
20
22
- it ( 'should take --no-timeouts option' , ( done ) => {
21
+ it ( 'should take --no-timeouts option' , ( ) => {
23
22
exec ( `${ config_run_config ( 'codecept.conf.js' , 'timed out' ) } --no-timeouts` , ( err , stdout ) => {
24
23
debug_this_test && console . log ( stdout ) ;
25
24
expect ( stdout ) . toContain ( 'Timeouts were disabled' ) ;
26
25
expect ( stdout ) . not . toContain ( 'Timeout 2s exceeded' ) ;
27
26
expect ( stdout ) . not . toContain ( 'Timeout 1s exceeded' ) ;
28
27
expect ( err ) . toBeFalsy ( ) ;
29
- done ( ) ;
30
28
} ) ;
31
29
} ) ;
32
30
33
- it ( 'should ignore timeouts if no timeout' , ( done ) => {
31
+ it ( 'should ignore timeouts if no timeout' , ( ) => {
34
32
exec ( config_run_config ( 'codecept.conf.js' , 'no timeout test' ) , ( err , stdout ) => {
35
33
debug_this_test && console . log ( stdout ) ;
36
34
expect ( stdout ) . not . toContain ( 'Timeout' ) ;
37
35
expect ( err ) . toBeFalsy ( ) ;
38
- done ( ) ;
39
36
} ) ;
40
37
} ) ;
41
38
42
- it ( 'should use global timeouts if timeout is set' , ( done ) => {
39
+ it ( 'should use global timeouts if timeout is set' , ( ) => {
43
40
exec ( config_run_config ( 'codecept.timeout.conf.js' , 'no timeout test' ) , ( err , stdout ) => {
44
41
debug_this_test && console . log ( stdout ) ;
45
42
expect ( stdout ) . toContain ( 'Timeout 0.1' ) ;
46
43
expect ( err ) . toBeTruthy ( ) ;
47
- done ( ) ;
48
44
} ) ;
49
45
} ) ;
50
46
51
- it ( 'should prefer step timeout' , ( done ) => {
47
+ it ( 'should prefer step timeout' , ( ) => {
52
48
exec ( config_run_config ( 'codecept.conf.js' , 'timeout step' , true ) , ( err , stdout ) => {
53
49
debug_this_test && console . log ( stdout ) ;
54
50
expect ( stdout ) . toContain ( 'was interrupted on step timeout 100ms' ) ;
55
51
expect ( err ) . toBeTruthy ( ) ;
56
- done ( ) ;
57
52
} ) ;
58
53
} ) ;
59
54
60
- it ( 'should keep timeout with steps' , ( done ) => {
55
+ it ( 'should keep timeout with steps' , ( ) => {
61
56
exec ( config_run_config ( 'codecept.timeout.conf.js' , 'timeout step' , true ) , ( err , stdout ) => {
62
57
debug_this_test && console . log ( stdout ) ;
63
58
expect ( stdout ) . toContain ( 'was interrupted on step timeout 100ms' ) ;
64
59
expect ( err ) . toBeTruthy ( ) ;
65
- done ( ) ;
66
60
} ) ;
67
61
} ) ;
68
62
69
- it ( 'should override timeout config from global object' , ( done ) => {
63
+ it ( 'should override timeout config from global object' , ( ) => {
70
64
exec ( config_run_config ( 'codecept.timeout.obj.conf.js' , '#first' , false ) , ( err , stdout ) => {
71
65
debug_this_test && console . log ( stdout ) ;
72
66
expect ( stdout ) . toContain ( 'Timeout 0.3s exceeded' ) ;
73
67
expect ( err ) . toBeTruthy ( ) ;
74
- done ( ) ;
75
68
} ) ;
76
69
} ) ;
77
70
78
- it ( 'should override timeout config from global object but respect local value' , ( done ) => {
71
+ it ( 'should override timeout config from global object but respect local value' , ( ) => {
79
72
exec ( config_run_config ( 'codecept.timeout.obj.conf.js' , '#second' ) , ( err , stdout ) => {
80
73
debug_this_test && console . log ( stdout ) ;
81
74
expect ( stdout ) . not . toContain ( 'Timeout 0.3s exceeded' ) ;
82
75
expect ( stdout ) . toContain ( 'Timeout 0.5s exceeded' ) ;
83
76
expect ( err ) . toBeTruthy ( ) ;
84
- done ( ) ;
85
77
} ) ;
86
78
} ) ;
87
79
88
- it ( 'should respect grep when overriding config from global config' , ( done ) => {
80
+ it ( 'should respect grep when overriding config from global config' , ( ) => {
89
81
exec ( config_run_config ( 'codecept.timeout.obj.conf.js' , '#fourth' ) , ( err , stdout ) => {
90
82
debug_this_test && console . log ( stdout ) ;
91
83
expect ( stdout ) . not . toContain ( 'Timeout 0.3s exceeded' ) ;
92
84
expect ( stdout ) . toContain ( 'Timeout 1s exceeded' ) ;
93
85
expect ( err ) . toBeTruthy ( ) ;
94
- done ( ) ;
95
86
} ) ;
96
87
} ) ;
97
88
} ) ;
0 commit comments