@@ -93,7 +93,7 @@ describe('generatePackageManifests', () => {
9393 } ;
9494 }
9595
96- it ( 'should generate a valid APF package.json for an unscoped package' , ( ) => {
96+ it ( 'should generate a valid APF package.json for an unscoped package' , async ( ) => {
9797 const options = createOptions ( {
9898 packageJson : {
9999 name : 'my-lib' ,
@@ -108,7 +108,7 @@ describe('generatePackageManifests', () => {
108108 } ,
109109 } ) ;
110110
111- const files = generatePackageManifests ( options , false ) ;
111+ const files = await generatePackageManifests ( options , false ) ;
112112 const result = getRootPackageJson ( files ) ;
113113
114114 expect ( result ) . toEqual ( {
@@ -131,15 +131,15 @@ describe('generatePackageManifests', () => {
131131 } ) ;
132132 } ) ;
133133
134- it ( 'should sanitize scoped package names in fesm and types paths' , ( ) => {
134+ it ( 'should sanitize scoped package names in fesm and types paths' , async ( ) => {
135135 const options = createOptions ( {
136136 packageJson : {
137137 name : '@my-scope/my-lib' ,
138138 version : '2.1.0' ,
139139 } ,
140140 } ) ;
141141
142- const files = generatePackageManifests ( options , false ) ;
142+ const files = await generatePackageManifests ( options , false ) ;
143143 const result = getRootPackageJson ( files ) ;
144144
145145 expect ( result ) . toEqual (
@@ -158,7 +158,7 @@ describe('generatePackageManifests', () => {
158158 ) ;
159159 } ) ;
160160
161- it ( 'should retain scripts when keepLifecycleScripts is true' , ( ) => {
161+ it ( 'should retain scripts when keepLifecycleScripts is true' , async ( ) => {
162162 const options = createOptions ( {
163163 keepLifecycleScripts : true ,
164164 packageJson : {
@@ -170,12 +170,12 @@ describe('generatePackageManifests', () => {
170170 } ,
171171 } ) ;
172172
173- const files = generatePackageManifests ( options , false ) ;
173+ const files = await generatePackageManifests ( options , false ) ;
174174 const result = getRootPackageJson ( files ) ;
175175 expect ( result . scripts ) . toEqual ( { postinstall : 'echo done' } ) ;
176176 } ) ;
177177
178- it ( 'should configure secondary entry points and create secondary manifests' , ( ) => {
178+ it ( 'should configure secondary entry points and create secondary manifests' , async ( ) => {
179179 const options = createOptions (
180180 {
181181 packageJson : {
@@ -186,7 +186,7 @@ describe('generatePackageManifests', () => {
186186 true ,
187187 ) ;
188188
189- const files = generatePackageManifests ( options , false ) ;
189+ const files = await generatePackageManifests ( options , false ) ;
190190 const result = getRootPackageJson ( files ) ;
191191
192192 expect ( result . exports ) . toEqual (
@@ -210,20 +210,20 @@ describe('generatePackageManifests', () => {
210210 expect ( npmignoreFile ?. contents ) . toContain ( '/testing/package.json' ) ;
211211 } ) ;
212212
213- it ( 'should inject watch version when isWatchMode is true' , ( ) => {
213+ it ( 'should inject watch version when isWatchMode is true' , async ( ) => {
214214 const options = createOptions ( {
215215 packageJson : {
216216 name : 'my-lib' ,
217217 version : '1.0.0' ,
218218 } ,
219219 } ) ;
220220
221- const files = generatePackageManifests ( options , true ) ;
221+ const files = await generatePackageManifests ( options , true ) ;
222222 const result = getRootPackageJson ( files ) ;
223223 expect ( result . version ) . toMatch ( / ^ 0 \. 0 \. 0 - w a t c h \+ \d + $ / ) ;
224224 } ) ;
225225
226- it ( 'should throw an error if primary entry point is missing' , ( ) => {
226+ it ( 'should throw an error if primary entry point is missing' , async ( ) => {
227227 const options = createOptions ( {
228228 packageJson : {
229229 name : 'my-lib' ,
@@ -232,12 +232,12 @@ describe('generatePackageManifests', () => {
232232 entryPoints : new Map ( ) ,
233233 } ) ;
234234
235- expect ( ( ) => generatePackageManifests ( options , false ) ) . toThrowError (
235+ await expectAsync ( generatePackageManifests ( options , false ) ) . toBeRejectedWithError (
236236 / P r i m a r y e n t r y p o i n t ' \. ' w a s n o t f o u n d i n e n t r y P o i n t s \. / ,
237237 ) ;
238238 } ) ;
239239
240- it ( 'should inject prepublishOnly guard script when compilationMode is full' , ( ) => {
240+ it ( 'should inject prepublishOnly guard script when compilationMode is full' , async ( ) => {
241241 const options = createOptions ( {
242242 compilationMode : 'full' ,
243243 packageJson : {
@@ -246,14 +246,14 @@ describe('generatePackageManifests', () => {
246246 } ,
247247 } ) ;
248248
249- const files = generatePackageManifests ( options , false ) ;
249+ const files = await generatePackageManifests ( options , false ) ;
250250 const result = getRootPackageJson ( files ) ;
251251 expect ( result . scripts ?. [ 'prepublishOnly' ] ) . toContain (
252252 'Trying to publish a package that has been compiled in full compilation mode' ,
253253 ) ;
254254 } ) ;
255255
256- it ( 'should preserve custom user exports in package.json and merge subpath conditions' , ( ) => {
256+ it ( 'should preserve custom user exports in package.json and merge subpath conditions' , async ( ) => {
257257 const options = createOptions ( {
258258 packageJson : {
259259 name : 'my-lib' ,
@@ -268,7 +268,7 @@ describe('generatePackageManifests', () => {
268268 } ,
269269 } ) ;
270270
271- const files = generatePackageManifests ( options , false ) ;
271+ const files = await generatePackageManifests ( options , false ) ;
272272 const result = getRootPackageJson ( files ) ;
273273
274274 expect ( result . exports ) . toEqual ( {
@@ -283,8 +283,8 @@ describe('generatePackageManifests', () => {
283283 } ) ;
284284 } ) ;
285285
286- it ( 'should default sideEffects to false if not specified, and preserve when set' , ( ) => {
287- const files1 = generatePackageManifests (
286+ it ( 'should default sideEffects to false if not specified, and preserve when set' , async ( ) => {
287+ const files1 = await generatePackageManifests (
288288 createOptions ( {
289289 packageJson : {
290290 name : 'my-lib' ,
@@ -295,7 +295,7 @@ describe('generatePackageManifests', () => {
295295 ) ;
296296 expect ( getRootPackageJson ( files1 ) . sideEffects ) . toBeFalse ( ) ;
297297
298- const files2 = generatePackageManifests (
298+ const files2 = await generatePackageManifests (
299299 createOptions ( {
300300 packageJson : {
301301 name : 'my-lib' ,
@@ -308,7 +308,7 @@ describe('generatePackageManifests', () => {
308308 expect ( getRootPackageJson ( files2 ) . sideEffects ) . toEqual ( [ '*.css' ] ) ;
309309 } ) ;
310310
311- it ( 'should conditionally inject tslib into dependencies only when hasTslibImport is true' , ( ) => {
311+ it ( 'should conditionally inject tslib into dependencies only when hasTslibImport is true' , async ( ) => {
312312 const options = createOptions ( {
313313 workspaceRoot : process . cwd ( ) ,
314314 packageJson : {
@@ -317,17 +317,17 @@ describe('generatePackageManifests', () => {
317317 } ,
318318 } ) ;
319319
320- const filesWithoutTslib = generatePackageManifests ( options , false , false ) ;
320+ const filesWithoutTslib = await generatePackageManifests ( options , false , false ) ;
321321 expect ( getRootPackageJson ( filesWithoutTslib ) . dependencies ) . toBeUndefined ( ) ;
322322
323- const filesWithTslib = generatePackageManifests ( options , false , true ) ;
323+ const filesWithTslib = await generatePackageManifests ( options , false , true ) ;
324324 expect ( getRootPackageJson ( filesWithTslib ) . dependencies ) . toEqual ( {
325325 tslib : jasmine . any ( String ) ,
326326 } ) ;
327327 } ) ;
328328
329- it ( 'should preserve existing user tslib declaration when hasTslibImport is true' , ( ) => {
330- const filesInDeps = generatePackageManifests (
329+ it ( 'should preserve existing user tslib declaration when hasTslibImport is true' , async ( ) => {
330+ const filesInDeps = await generatePackageManifests (
331331 createOptions ( {
332332 workspaceRoot : process . cwd ( ) ,
333333 packageJson : {
0 commit comments