File tree Expand file tree Collapse file tree 2 files changed +40
-9
lines changed
packages/enhanced/test/unit/sharing Expand file tree Collapse file tree 2 files changed +40
-9
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,20 @@ export const createMockCompilation = () => {
197
197
} ,
198
198
resolverFactory : {
199
199
get : jest . fn ( ) . mockReturnValue ( {
200
- resolve : jest . fn ( ) . mockResolvedValue ( { path : '/resolved/path' } ) ,
200
+ resolve : jest
201
+ . fn ( )
202
+ . mockImplementation (
203
+ (
204
+ resolveOptions ,
205
+ resolveFrom ,
206
+ resolveTo ,
207
+ resolveContext ,
208
+ callback ,
209
+ ) => {
210
+ // Mock successful resolution with correct 5-parameter signature
211
+ callback ( null , '/resolved/' + resolveTo ) ;
212
+ } ,
213
+ ) ,
201
214
} ) ,
202
215
} ,
203
216
codeGenerationResults : {
@@ -363,10 +376,20 @@ export const createSharingTestEnvironment = () => {
363
376
mockCompilation . context = compiler . context ;
364
377
mockCompilation . resolverFactory = {
365
378
get : jest . fn ( ) . mockReturnValue ( {
366
- resolve : jest . fn ( ) . mockImplementation ( ( context , request , callback ) => {
367
- // Mock successful resolution
368
- callback ( null , '/resolved/' + request ) ;
369
- } ) ,
379
+ resolve : jest
380
+ . fn ( )
381
+ . mockImplementation (
382
+ (
383
+ resolveOptions ,
384
+ resolveFrom ,
385
+ resolveTo ,
386
+ resolveContext ,
387
+ callback ,
388
+ ) => {
389
+ // Mock successful resolution with correct 5-parameter signature
390
+ callback ( null , '/resolved/' + resolveTo ) ;
391
+ } ,
392
+ ) ,
370
393
} ) ,
371
394
} ;
372
395
Original file line number Diff line number Diff line change @@ -69,7 +69,9 @@ async function main() {
69
69
json . version = version ;
70
70
writeFileSync ( packageJsonPath , JSON . stringify ( json , null , 2 ) ) ;
71
71
72
- console . log ( chalk . green ( `Updated version from ${ oldVersion } to ${ version } ` ) ) ;
72
+ console . log (
73
+ chalk . green ( `Updated version from ${ oldVersion } to ${ version } ` ) ,
74
+ ) ;
73
75
} catch ( e ) {
74
76
console . error (
75
77
chalk . bold . red (
@@ -82,9 +84,15 @@ async function main() {
82
84
83
85
// Execute "npm publish" to publish
84
86
try {
85
- console . log ( chalk . blue ( `Publishing with command: npm publish --access public --tag ${ tag } ` ) ) ;
87
+ console . log (
88
+ chalk . blue (
89
+ `Publishing with command: npm publish --access public --tag ${ tag } ` ,
90
+ ) ,
91
+ ) ;
86
92
execSync ( `npm publish --access public --tag ${ tag } ` , { stdio : 'inherit' } ) ;
87
- console . log ( chalk . green ( `Successfully published ${ name } @${ version } with tag: ${ tag } ` ) ) ;
93
+ console . log (
94
+ chalk . green ( `Successfully published ${ name } @${ version } with tag: ${ tag } ` ) ,
95
+ ) ;
88
96
} catch ( error ) {
89
97
console . error ( chalk . bold . red ( 'Failed to publish package:' ) , error ) ;
90
98
process . exit ( 1 ) ;
@@ -95,4 +103,4 @@ async function main() {
95
103
main ( ) . catch ( ( error ) => {
96
104
console . error ( chalk . bold . red ( 'Unexpected error:' ) , error ) ;
97
105
process . exit ( 1 ) ;
98
- } ) ;
106
+ } ) ;
You can’t perform that action at this time.
0 commit comments