File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
source/runner/runners/utils/_tests Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -95,9 +95,14 @@ describe("babelify", () => {
95
95
const dangerfile = `import { a } from 'lodash';
96
96
a();`
97
97
98
- const existsSyncMock = fs . existsSync as jest . Mock
99
98
const actualFs = jest . requireActual ( "fs" ) as typeof fs
99
+ const existsSyncMock = fs . existsSync as jest . Mock
100
+ const statSyncMock = fs . statSync as jest . Mock
100
101
existsSyncMock . mockImplementation ( ( path ) => path === "/a/b/babel.config.js" || actualFs . existsSync ( path ) )
102
+ statSyncMock . mockImplementation ( ( path ) =>
103
+ // browserslist gets called by babelify, and browserslist checks for all imported things to see if they're directories
104
+ path === "/a/b/babel.config.js" ? { isDirectory : ( ) => false } : actualFs . statSync ( path )
105
+ )
101
106
jest . mock (
102
107
"/a/b/babel.config.js" ,
103
108
( ) => {
You can’t perform that action at this time.
0 commit comments