@@ -6,7 +6,7 @@ import * as tl from "azure-pipelines-task-lib/task";
6
6
7
7
const tempDir = path . join ( __dirname , "temp" ) ;
8
8
9
- describe ( 'Twine Authenticate V1 Suite' , function ( ) {
9
+ describe ( 'Twine Authenticate V1 Suite' , async ( ) => {
10
10
before ( ( ) => {
11
11
tl . mkdirP ( tempDir ) ;
12
12
} ) ;
@@ -15,12 +15,11 @@ describe('Twine Authenticate V1 Suite', function () {
15
15
tl . rmRF ( tempDir ) ;
16
16
} ) ;
17
17
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 ( ) => {
20
19
let tp = path . join ( __dirname , './setAuthInternalFeed.js' )
21
20
let tr : ttm . MockTestRunner = new ttm . MockTestRunner ( tp ) ;
22
21
23
- tr . run ( ) ;
22
+ await tr . runAsync ( ) ;
24
23
assert ( tr . invokedToolCount == 0 , 'no tool should be invoked.' ) ;
25
24
assert ( tr . succeeded , 'should have succeeded' ) ;
26
25
assert . strictEqual ( tr . errorIssues . length , 0 , "should have no errors" ) ;
@@ -39,16 +38,13 @@ describe('Twine Authenticate V1 Suite', function () {
39
38
"Default username should be correct." ) ;
40
39
assert . strictEqual ( lines [ 6 ] , "password=token" ,
41
40
"Default password from environment variable should be correct." ) ;
41
+ } ) . timeout ( 50000 ) ;
42
42
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 ( ) => {
48
44
let tp = path . join ( __dirname , './setAuthInternalFeedWithDot.js' )
49
45
let tr : ttm . MockTestRunner = new ttm . MockTestRunner ( tp ) ;
50
46
51
- tr . run ( ) ;
47
+ await tr . runAsync ( ) ;
52
48
assert ( tr . invokedToolCount == 0 , 'no tool should be invoked.' ) ;
53
49
assert ( tr . succeeded , 'should have succeeded' ) ;
54
50
assert . strictEqual ( tr . errorIssues . length , 0 , "should have no errors" ) ;
@@ -57,17 +53,15 @@ describe('Twine Authenticate V1 Suite', function () {
57
53
let lines = fileContent . split ( / \r ? \n / ) ;
58
54
59
55
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." ) ;
63
59
assert . strictEqual ( lines . at ( - 6 ) , "[Test.Feed]" ) ;
64
60
assert . strictEqual ( lines . at ( - 5 ) , "repository=https://vsts/packagesource/Test.Feed" ,
65
61
"Test Feed repository should be correct." ) ;
66
62
assert . strictEqual ( lines . at ( - 4 ) , "username=build" ,
67
63
"Default username should be correct." ) ;
68
64
assert . strictEqual ( lines . at ( - 3 ) , "password=token" ,
69
65
"Default password from environment variable should be correct." ) ;
70
-
71
- done ( ) ;
72
- } ) ;
66
+ } ) . timeout ( 50000 ) ;
73
67
} ) ;
0 commit comments