Skip to content

Commit 3bc744e

Browse files
Update azure-pipelines-task-lib version in CmdLineV2 (#20217)
* Upgrade azure-pipelines-task-lib version * Generate task and update tests
1 parent c5c4b01 commit 3bc744e

File tree

18 files changed

+548
-411
lines changed

18 files changed

+548
-411
lines changed

Tasks/CmdLineV2/Tests/L0.ts

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ describe('Cmd Suite', function () {
2525
let tp: string = path.join(__dirname, 'L0Inline.js');
2626
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
2727

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+
});
3536
});
3637

3738
it('Reports stderr correctly', (done: Done) => {
@@ -40,13 +41,14 @@ describe('Cmd Suite', function () {
4041
let tp: string = path.join(__dirname, 'L0StdErr.js');
4142
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
4243

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+
});
5052
});
5153

5254
it('Fails on null exit code', (done: Done) => {
@@ -55,10 +57,11 @@ describe('Cmd Suite', function () {
5557
let tp: string = path.join(__dirname, 'L0FailOnExitCodeNull.js');
5658
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
5759

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+
});
6366
});
6467
});

0 commit comments

Comments
 (0)