Skip to content

Commit 569ba09

Browse files
authored
Bump task lib in ABTT tasks. Part 3 (#20303)
* Update DotNetCoreCLIV2 * Update DotNetCoreInstallerV0 * Update GradleV2 * Update GradleV3 * Update FtpUploadV1 * Update FtpUploadV2 * Update DownloadSecureFileV1 * Update ExtractFilesV1 * Update DeleteFilesV1 * Update DotNetCoreInstallerV1 * Update DeleteFilesV1 version
1 parent 4a8dde7 commit 569ba09

File tree

176 files changed

+11938
-12779
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+11938
-12779
lines changed

Tasks/DeleteFilesV1/Tests/L0.ts

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,18 @@ describe('DeleteFiles Suite', function () {
2727
fs.mkdirSync(testRoot);
2828
})
2929

30-
function runValidations(validator: () => void, tr, done) {
30+
function runValidations(validator: () => void, tr: ttm.MockTestRunner) {
3131
try {
3232
validator();
33-
done();
3433
}
3534
catch (error) {
3635
console.log("STDERR", tr.stderr);
3736
console.log("STDOUT", tr.stdout);
38-
done(error);
37+
throw error;
3938
}
4039
}
4140

42-
it('Deletes multiple nested folders', (done: Mocha.Done) => {
41+
it('Deletes multiple nested folders', async () => {
4342
this.timeout(5000);
4443

4544
const root = path.join(testRoot, 'nested');
@@ -58,17 +57,17 @@ describe('DeleteFiles Suite', function () {
5857
let tp: string = path.join(__dirname, 'L0Nested.js');
5958
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
6059

61-
tr.run();
60+
await tr.runAsync();
6261

6362
runValidations(() => {
6463
assert(!fs.existsSync(path.join(root, 'A')));
6564
assert(!fs.existsSync(path.join(root, 'B')));
6665
assert(fs.existsSync(path.join(root, 'C')));
6766
assert(fs.existsSync(path.join(root, 'C', 'dontDelete.txt')));
68-
}, tr, done);
67+
}, tr);
6968
});
7069

71-
it('Deletes files with negate pattern', (done: Mocha.Done) => {
70+
it('Deletes files with negate pattern', async () => {
7271
this.timeout(5000);
7372

7473
const root = path.join(testRoot, 'negate');
@@ -81,15 +80,15 @@ describe('DeleteFiles Suite', function () {
8180
let tp: string = path.join(__dirname, 'L0Negate.js');
8281
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
8382

84-
tr.run();
83+
await tr.runAsync();
8584

8685
runValidations(() => {
8786
assert(!fs.existsSync(path.join(root, 'A', 'test2.css')));
8887
assert(fs.existsSync(path.join(root, 'A', 'test1.js')));
89-
}, tr, done);
88+
}, tr);
9089
});
9190

92-
it('Deletes files starting with a dot', (done: Mocha.Done) => {
91+
it('Deletes files starting with a dot', async () => {
9392
const root = path.join(testRoot, 'removeDotFiles');
9493
fs.mkdirSync(root);
9594

@@ -100,15 +99,15 @@ describe('DeleteFiles Suite', function () {
10099
let tp: string = path.join(__dirname, 'L0RemoveDotFiles.js');
101100
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
102101

103-
tr.run();
102+
await tr.runAsync();
104103

105104
runValidations(() => {
106105
assert(!fs.existsSync(path.join(root, 'A', '.txt')));
107106
assert(!fs.existsSync(path.join(root, 'A', '.sample.txt')));
108-
}, tr, done);
107+
}, tr);
109108
});
110109

111-
it('Doesnt delete files starting with a dot', (done: Mocha.Done) => {
110+
it('Doesnt delete files starting with a dot', async () => {
112111
const root = path.join(testRoot, 'DoesntRemoveDotFiles');
113112
fs.mkdirSync(root);
114113

@@ -119,15 +118,15 @@ describe('DeleteFiles Suite', function () {
119118
let tp: string = path.join(__dirname, 'L0DoesntRemoveDotFiles.js');
120119
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
121120

122-
tr.run();
121+
await tr.runAsync();
123122

124123
runValidations(() => {
125124
assert(fs.existsSync(path.join(root, 'A', '.txt')));
126125
assert(fs.existsSync(path.join(root, 'A', '.sample.txt')));
127-
}, tr, done);
126+
}, tr);
128127
});
129128

130-
it('Deletes files using braces statement', (done: Mocha.Done) => {
129+
it('Deletes files using braces statement', async () => {
131130
this.timeout(5000);
132131

133132
const root = path.join(testRoot, 'braces');
@@ -142,17 +141,17 @@ describe('DeleteFiles Suite', function () {
142141
let tp: string = path.join(__dirname, 'L0Braces.js');
143142
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
144143

145-
tr.run();
144+
await tr.runAsync();
146145

147146
runValidations(() => {
148147
assert(!fs.existsSync(path.join(root, 'A', 'one.txt')));
149148
assert(!fs.existsSync(path.join(root, 'A', 'two.txt')));
150149
assert(fs.existsSync(path.join(root, 'A', 'three.txt')));
151150
assert(fs.existsSync(path.join(root, 'A', 'four.txt')));
152-
}, tr, done);
151+
}, tr);
153152
});
154153

155-
it('Deletes a single file', (done: Mocha.Done) => {
154+
it('Deletes a single file', async () => {
156155
this.timeout(5000);
157156

158157
const root = path.join(testRoot, 'singleFile');
@@ -167,18 +166,18 @@ describe('DeleteFiles Suite', function () {
167166
let tp: string = path.join(__dirname, 'L0SingleFile.js');
168167
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
169168

170-
tr.run();
169+
await tr.runAsync();
171170

172171
runValidations(() => {
173172
assert(fs.existsSync(path.join(root, 'A')));
174173
assert(!fs.existsSync(path.join(root, 'A', 'test.txt')));
175174
assert(fs.existsSync(path.join(root, 'A', 'A')));
176175
assert(fs.existsSync(path.join(root, 'A', 'A', 'test.txt')));
177176
assert(fs.existsSync(path.join(root, 'A', 'A', 'test2.txt')));
178-
}, tr, done);
177+
}, tr);
179178
});
180179

181-
it('Removes the source folder if its empty', (done: Mocha.Done) => {
180+
it('Removes the source folder if its empty', async () => {
182181
this.timeout(5000);
183182

184183
const root = path.join(testRoot, 'rmSource');
@@ -193,14 +192,14 @@ describe('DeleteFiles Suite', function () {
193192
let tp: string = path.join(__dirname, 'L0RmSource.js');
194193
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
195194

196-
tr.run();
195+
await tr.runAsync();
197196

198197
runValidations(() => {
199198
assert(!fs.existsSync(root));
200-
}, tr, done);
199+
}, tr);
201200
});
202201

203-
it('Doesnt remove folder outside the root', (done: Mocha.Done) => {
202+
it('Doesnt remove folder outside the root', async () => {
204203
this.timeout(5000);
205204

206205
const root = path.join(testRoot, 'insideRoot');
@@ -213,14 +212,14 @@ describe('DeleteFiles Suite', function () {
213212
let tp: string = path.join(__dirname, 'L0OutsideRoot.js');
214213
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
215214

216-
tr.run();
215+
await tr.runAsync();
217216

218217
runValidations(() => {
219218
assert(fs.existsSync(path.join(outsideRoot, 'test.txt')));
220-
}, tr, done);
219+
}, tr);
221220
});
222221

223-
it('Removes folder with locked file', (done: Mocha.Done) => {
222+
it('Removes folder with locked file', async () => {
224223
this.timeout(5000);
225224

226225
const root = path.join(testRoot, 'locked');
@@ -233,7 +232,7 @@ describe('DeleteFiles Suite', function () {
233232
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
234233

235234
try {
236-
tr.run();
235+
await tr.runAsync();
237236
}
238237
catch (err) {}
239238
finally {
@@ -243,6 +242,6 @@ describe('DeleteFiles Suite', function () {
243242
runValidations(() => {
244243
assert(!fs.existsSync(path.join(root, 'A')));
245244
assert(tr.succeeded);
246-
}, tr, done);
245+
}, tr);
247246
});
248247
});

0 commit comments

Comments
 (0)