@@ -25,13 +25,14 @@ describe('Cmd Suite', function () {
25
25
let tp : string = path . join ( __dirname , 'L0Inline.js' ) ;
26
26
let tr : ttm . MockTestRunner = new ttm . MockTestRunner ( tp ) ;
27
27
28
- tr . run ( ) ;
29
-
30
- runValidations ( ( ) => {
31
- assert ( tr . succeeded , 'Cmd should have succeeded.' ) ;
32
- assert ( tr . stderr . length === 0 , 'Cmd should not have written to stderr' ) ;
33
- assert ( tr . stdout . indexOf ( 'my script output' ) > 0 , 'Cmd should have correctly run the script' ) ;
34
- } , tr , done ) ;
28
+ tr . runAsync ( )
29
+ . then ( ( ) => {
30
+ runValidations ( ( ) => {
31
+ assert ( tr . succeeded , 'Cmd should have succeeded.' ) ;
32
+ assert ( tr . stderr . length === 0 , 'Cmd should not have written to stderr' ) ;
33
+ assert ( tr . stdout . indexOf ( 'my script output' ) > 0 , 'Cmd should have correctly run the script' ) ;
34
+ } , tr , done ) ;
35
+ } ) ;
35
36
} ) ;
36
37
37
38
it ( 'Reports stderr correctly' , ( done : Done ) => {
@@ -40,13 +41,14 @@ describe('Cmd Suite', function () {
40
41
let tp : string = path . join ( __dirname , 'L0StdErr.js' ) ;
41
42
let tr : ttm . MockTestRunner = new ttm . MockTestRunner ( tp ) ;
42
43
43
- tr . run ( ) ;
44
-
45
- runValidations ( ( ) => {
46
- assert ( tr . failed , 'Bash should have failed' ) ;
47
- assert ( tr . stdout . indexOf ( '##vso[task.issue type=error;source=CustomerScript;]myErrorTest' ) > 0 , 'Bash should have correctly written myErrorTest' ) ;
48
- assert ( tr . stdout . length > 1000 , 'Bash stderr output is not truncated' ) ;
49
- } , tr , done ) ;
44
+ tr . runAsync ( )
45
+ . then ( ( ) => {
46
+ runValidations ( ( ) => {
47
+ assert ( tr . failed , 'Bash should have failed' ) ;
48
+ assert ( tr . stdout . indexOf ( '##vso[task.issue type=error;source=CustomerScript;]myErrorTest' ) > 0 , 'Bash should have correctly written myErrorTest' ) ;
49
+ assert ( tr . stdout . length > 1000 , 'Bash stderr output is not truncated' ) ;
50
+ } , tr , done ) ;
51
+ } ) ;
50
52
} ) ;
51
53
52
54
it ( 'Fails on null exit code' , ( done : Done ) => {
@@ -55,10 +57,11 @@ describe('Cmd Suite', function () {
55
57
let tp : string = path . join ( __dirname , 'L0FailOnExitCodeNull.js' ) ;
56
58
let tr : ttm . MockTestRunner = new ttm . MockTestRunner ( tp ) ;
57
59
58
- tr . run ( ) ;
59
-
60
- runValidations ( ( ) => {
61
- assert ( tr . failed , 'Bash should have failed when the script exits with null code' ) ;
62
- } , tr , done ) ;
60
+ tr . runAsync ( )
61
+ . then ( ( ) => {
62
+ runValidations ( ( ) => {
63
+ assert ( tr . failed , 'Bash should have failed when the script exits with null code' ) ;
64
+ } , tr , done ) ;
65
+ } ) ;
63
66
} ) ;
64
67
} ) ;
0 commit comments