diff --git a/packages/jest-preset-default/jest-preset.js b/packages/jest-preset-default/jest-preset.js index badc6fc70efb9b..0e5d04f5f6e53b 100644 --- a/packages/jest-preset-default/jest-preset.js +++ b/packages/jest-preset-default/jest-preset.js @@ -1,31 +1,26 @@ module.exports = { moduleNameMapper: { - '\\.(scss|css)$': - '/node_modules/@wordpress/jest-preset-default/scripts/style-mock.js', + '\\.(scss|css)$': require.resolve( '@wordpress/jest-preset-default/scripts/style-mock.js' ), }, modulePaths: [ '' ], - setupFiles: [ - '/node_modules/@wordpress/jest-preset-default/scripts/setup-globals.js', - ], + setupFiles: [ require.resolve( '@wordpress/jest-preset-default/scripts/setup-globals.js' ) ], setupFilesAfterEnv: [ - '/node_modules/@wordpress/jest-preset-default/scripts/setup-test-framework.js', - ], - snapshotSerializers: [ '/node_modules/enzyme-to-json/serializer.js' ], - testMatch: [ - '**/__tests__/**/*.[jt]s', - '**/test/*.[jt]s', - '**/?(*.)test.[jt]s', + require.resolve( '@wordpress/jest-preset-default/scripts/setup-test-framework.js' ), ], + snapshotSerializers: [ require.resolve( 'enzyme-to-json/serializer.js' ) ], + testMatch: [ '**/__tests__/**/*.[jt]s', '**/test/*.[jt]s', '**/?(*.)test.[jt]s' ], testPathIgnorePatterns: [ '/node_modules/', '/wordpress/' ], timers: 'fake', transform: { - '^.+\\.[jt]sx?$': '/node_modules/babel-jest', + '^.+\\.[jt]sx?$': require.resolve( 'babel-jest' ), }, verbose: true, reporters: - 'TRAVIS' in process.env && 'CI' in process.env ? - [ - '../../../@wordpress/jest-preset-default/scripts/travis-fold-passes-reporter.js', - ] : - undefined, + 'TRAVIS' in process.env && 'CI' in process.env + ? [ + require.resolve( + '@wordpress/jest-preset-default/scripts/travis-fold-passes-reporter.js' + ), + ] + : undefined, };