File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -245,16 +245,17 @@ export const build = async (...files) => {
245245
246246 // copy of loader/jest
247247 input . push ( `await (await import(${ stringify ( resolveSrc ( 'jest.setup.js' ) ) } )).setupJest();` )
248-
249- const ignoreFrom = / \/ t e s t \/ s r c \/ ( j e s t ( \. ( m o c k | s n a p s h o t ) ) ? \. j s | e n g i n e \. p u r e \. c j s | e x p e c t \. c j s ) $ / u // rechecked to not use those apis if no outside usage
250- specificLoadPipeline . push ( async ( source , filepath ) => {
251- if ( ignoreFrom . test ( filepath . replaceAll ( '\\' , '/' ) ) ) return source
252- haveJestAPIs . expect ||= / ( ^ | [ ^ # ] ) \b e x p e c t ( [ ( . ] | $ ) / mu. test ( source )
253- haveJestAPIs . exodus ||= / j e s t \. e x o d u s / u. test ( source )
254- return source
255- } )
256248 }
257249
250+ const ignoreFrom = / \/ t e s t \/ s r c \/ ( j e s t ( \. ( m o c k | s n a p s h o t ) ) ? \. j s | e n g i n e \. p u r e \. c j s | e x p e c t \. c j s ) $ / u // rechecked to not use those apis if no outside usage
251+ specificLoadPipeline . push ( async ( source , filepath ) => {
252+ if ( ignoreFrom . test ( filepath . replaceAll ( '\\' , '/' ) ) ) return source
253+ if ( ! options . jest && ! / @ ( e x o d u s \/ t e s t \/ j e s t | j e s t \/ g l o b a l s ) / u. test ( source ) ) return source
254+ haveJestAPIs . expect ||= / ( ^ | [ ^ # ] ) \b e x p e c t ( [ ( . ] | $ ) / mu. test ( source )
255+ haveJestAPIs . exodus ||= / j e s t \. e x o d u s / u. test ( source )
256+ return source
257+ } )
258+
258259 for ( const file of files ) importFile ( file )
259260
260261 const filename = files . length === 1 ? `${ files [ 0 ] } -${ uuid ( ) . slice ( 0 , 8 ) } ` : `bundle-${ uuid ( ) } `
You can’t perform that action at this time.
0 commit comments