Skip to content

Commit 6672f17

Browse files
twineauthwenticateV0 mask auth, update dependency (#20268)
1 parent eb3c17e commit 6672f17

File tree

21 files changed

+1441
-1572
lines changed

21 files changed

+1441
-1572
lines changed

Tasks/TwineAuthenticateV1/Tests/L0.ts

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as tl from "azure-pipelines-task-lib/task";
66

77
const tempDir = path.join(__dirname, "temp");
88

9-
describe('Twine Authenticate V1 Suite', function () {
9+
describe('Twine Authenticate V1 Suite', async () => {
1010
before(() => {
1111
tl.mkdirP(tempDir);
1212
});
@@ -15,12 +15,11 @@ describe('Twine Authenticate V1 Suite', function () {
1515
tl.rmRF(tempDir);
1616
});
1717

18-
it('sets authentication for current organization feed', function (done: Mocha.Done) {
19-
this.timeout(50000);
18+
it('sets authentication for current organization feed', async () => {
2019
let tp = path.join(__dirname, './setAuthInternalFeed.js')
2120
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
2221

23-
tr.run();
22+
await tr.runAsync();
2423
assert(tr.invokedToolCount == 0, 'no tool should be invoked.');
2524
assert(tr.succeeded, 'should have succeeded');
2625
assert.strictEqual(tr.errorIssues.length, 0, "should have no errors");
@@ -39,16 +38,13 @@ describe('Twine Authenticate V1 Suite', function () {
3938
"Default username should be correct.");
4039
assert.strictEqual(lines[6], "password=token",
4140
"Default password from environment variable should be correct.");
41+
}).timeout(50000);
4242

43-
done();
44-
});
45-
46-
it('sets authentication for current organization feed', (done: MochaDone) => {
47-
this.timeout(10000);
43+
it('sets authentication for current organization feed with dot', async () => {
4844
let tp = path.join(__dirname, './setAuthInternalFeedWithDot.js')
4945
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
5046

51-
tr.run();
47+
await tr.runAsync();
5248
assert(tr.invokedToolCount == 0, 'no tool should be invoked.');
5349
assert(tr.succeeded, 'should have succeeded');
5450
assert.strictEqual(tr.errorIssues.length, 0, "should have no errors");
@@ -57,17 +53,15 @@ describe('Twine Authenticate V1 Suite', function () {
5753
let lines = fileContent.split(/\r?\n/);
5854

5955
assert.strictEqual(lines[0], "[distutils]");
60-
assert((lines[1] === "index-servers=Test.Feed")
61-
|| (lines[1].startsWith('index-servers=') && lines[1].endsWith('Test.Feed')),
62-
"Test Feed should be added to auth list.");
56+
assert((lines[1] === "index-servers=Test.Feed")
57+
|| (lines[1].startsWith('index-servers=') && lines[1].endsWith('Test.Feed')),
58+
"Test Feed should be added to auth list.");
6359
assert.strictEqual(lines.at(-6), "[Test.Feed]");
6460
assert.strictEqual(lines.at(-5), "repository=https://vsts/packagesource/Test.Feed",
6561
"Test Feed repository should be correct.");
6662
assert.strictEqual(lines.at(-4), "username=build",
6763
"Default username should be correct.");
6864
assert.strictEqual(lines.at(-3), "password=token",
6965
"Default password from environment variable should be correct.");
70-
71-
done();
72-
});
66+
}).timeout(50000);
7367
});

0 commit comments

Comments
 (0)