@@ -19,7 +19,7 @@ import { WorkspaceDefinition } from './definitions';
19
19
import { WorkspaceHost } from './host' ;
20
20
21
21
describe ( 'readWorkspace' , ( ) => {
22
- it ( 'attempts to read from specified file path [angular.json]' , async ( done ) => {
22
+ it ( 'attempts to read from specified file path [angular.json]' , async ( ) => {
23
23
const requestedPath = '/path/to/workspace/angular.json' ;
24
24
25
25
const host : WorkspaceHost = {
@@ -42,11 +42,9 @@ describe('readWorkspace', () => {
42
42
} ;
43
43
44
44
await readWorkspace ( requestedPath , host ) ;
45
-
46
- done ( ) ;
47
45
} ) ;
48
46
49
- it ( 'attempts to read from specified file path [.angular.json]' , async ( done ) => {
47
+ it ( 'attempts to read from specified file path [.angular.json]' , async ( ) => {
50
48
const requestedPath = '/path/to/workspace/.angular.json' ;
51
49
52
50
const host : WorkspaceHost = {
@@ -69,11 +67,9 @@ describe('readWorkspace', () => {
69
67
} ;
70
68
71
69
await readWorkspace ( requestedPath , host ) ;
72
-
73
- done ( ) ;
74
70
} ) ;
75
71
76
- it ( 'attempts to read from specified non-standard file path with format' , async ( done ) => {
72
+ it ( 'attempts to read from specified non-standard file path with format' , async ( ) => {
77
73
const requestedPath = '/path/to/workspace/abc.json' ;
78
74
79
75
const host : WorkspaceHost = {
@@ -96,11 +92,9 @@ describe('readWorkspace', () => {
96
92
} ;
97
93
98
94
await readWorkspace ( requestedPath , host , WorkspaceFormat . JSON ) ;
99
-
100
- done ( ) ;
101
95
} ) ;
102
96
103
- it ( 'errors when reading from specified non-standard file path without format' , async ( done ) => {
97
+ it ( 'errors when reading from specified non-standard file path without format' , async ( ) => {
104
98
const requestedPath = '/path/to/workspace/abc.json' ;
105
99
106
100
const host : WorkspaceHost = {
@@ -128,11 +122,9 @@ describe('readWorkspace', () => {
128
122
} catch ( e ) {
129
123
expect ( e . message ) . toContain ( 'Unable to determine format for workspace path' ) ;
130
124
}
131
-
132
- done ( ) ;
133
125
} ) ;
134
126
135
- it ( 'errors when reading from specified file path with invalid specified format' , async ( done ) => {
127
+ it ( 'errors when reading from specified file path with invalid specified format' , async ( ) => {
136
128
const requestedPath = '/path/to/workspace/angular.json' ;
137
129
138
130
const host : WorkspaceHost = {
@@ -160,11 +152,9 @@ describe('readWorkspace', () => {
160
152
} catch ( e ) {
161
153
expect ( e . message ) . toContain ( 'Unsupported workspace format' ) ;
162
154
}
163
-
164
- done ( ) ;
165
155
} ) ;
166
156
167
- it ( 'attempts to find/read from directory path' , async ( done ) => {
157
+ it ( 'attempts to find/read from directory path' , async ( ) => {
168
158
const requestedPath = getSystemPath ( normalize ( '/path/to/workspace' ) ) ;
169
159
const expectedFile = getSystemPath ( join ( normalize ( requestedPath ) , '.angular.json' ) ) ;
170
160
@@ -201,11 +191,9 @@ describe('readWorkspace', () => {
201
191
getSystemPath ( join ( normalize ( requestedPath ) , '.angular.json' ) ) ,
202
192
] . sort ( ) ,
203
193
) ;
204
-
205
- done ( ) ;
206
194
} ) ;
207
195
208
- it ( 'attempts to find/read only files for specified format from directory path' , async ( done ) => {
196
+ it ( 'attempts to find/read only files for specified format from directory path' , async ( ) => {
209
197
const requestedPath = '/path/to/workspace' ;
210
198
211
199
const isFileChecks : string [ ] = [ ] ;
@@ -246,11 +234,9 @@ describe('readWorkspace', () => {
246
234
247
235
readFileChecks . sort ( ) ;
248
236
expect ( readFileChecks ) . toEqual ( [ getSystemPath ( join ( normalize ( requestedPath ) , 'angular.json' ) ) ] ) ;
249
-
250
- done ( ) ;
251
237
} ) ;
252
238
253
- it ( 'errors when no file found from specified directory path' , async ( done ) => {
239
+ it ( 'errors when no file found from specified directory path' , async ( ) => {
254
240
const requestedPath = '/path/to/workspace' ;
255
241
256
242
const host : WorkspaceHost = {
@@ -280,13 +266,11 @@ describe('readWorkspace', () => {
280
266
} catch ( e ) {
281
267
expect ( e . message ) . toContain ( 'Unable to locate a workspace file' ) ;
282
268
}
283
-
284
- done ( ) ;
285
269
} ) ;
286
270
} ) ;
287
271
288
272
describe ( 'writeWorkspace' , ( ) => {
289
- it ( 'attempts to write to specified file path' , async ( done ) => {
273
+ it ( 'attempts to write to specified file path' , async ( ) => {
290
274
const requestedPath = '/path/to/workspace/angular.json' ;
291
275
292
276
let writtenPath : string | undefined ;
@@ -314,11 +298,9 @@ describe('writeWorkspace', () => {
314
298
315
299
await writeWorkspace ( { } as WorkspaceDefinition , host , requestedPath , WorkspaceFormat . JSON ) ;
316
300
expect ( writtenPath ) . toBe ( requestedPath ) ;
317
-
318
- done ( ) ;
319
301
} ) ;
320
302
321
- it ( 'errors when writing to specified file path with invalid specified format' , async ( done ) => {
303
+ it ( 'errors when writing to specified file path with invalid specified format' , async ( ) => {
322
304
const requestedPath = '/path/to/workspace/angular.json' ;
323
305
324
306
const host : WorkspaceHost = {
@@ -348,11 +330,9 @@ describe('writeWorkspace', () => {
348
330
} catch ( e ) {
349
331
expect ( e . message ) . toContain ( 'Unsupported workspace format' ) ;
350
332
}
351
-
352
- done ( ) ;
353
333
} ) ;
354
334
355
- it ( 'errors when writing custom workspace without specified format' , async ( done ) => {
335
+ it ( 'errors when writing custom workspace without specified format' , async ( ) => {
356
336
const requestedPath = '/path/to/workspace/angular.json' ;
357
337
358
338
const host : WorkspaceHost = {
@@ -382,7 +362,5 @@ describe('writeWorkspace', () => {
382
362
} catch ( e ) {
383
363
expect ( e . message ) . toContain ( 'A format is required' ) ;
384
364
}
385
-
386
- done ( ) ;
387
365
} ) ;
388
366
} ) ;
0 commit comments