Skip to content

Commit

Permalink
Use require.resolve() instead of <rootDir> in @wordpress/jest-preset-…
Browse files Browse the repository at this point in the history
…default (#19957)

* use require.resolve() instead of <rootDir>

* formatted
  • Loading branch information
jameslnewell authored Jan 30, 2020
1 parent ea705dd commit d17bd4b
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions packages/jest-preset-default/jest-preset.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
module.exports = {
moduleNameMapper: {
'\\.(scss|css)$':
'<rootDir>/node_modules/@wordpress/jest-preset-default/scripts/style-mock.js',
'\\.(scss|css)$': require.resolve( '@wordpress/jest-preset-default/scripts/style-mock.js' ),
},
modulePaths: [ '<rootDir>' ],
setupFiles: [
'<rootDir>/node_modules/@wordpress/jest-preset-default/scripts/setup-globals.js',
],
setupFiles: [ require.resolve( '@wordpress/jest-preset-default/scripts/setup-globals.js' ) ],
setupFilesAfterEnv: [
'<rootDir>/node_modules/@wordpress/jest-preset-default/scripts/setup-test-framework.js',
],
snapshotSerializers: [ '<rootDir>/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?$': '<rootDir>/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,
};

0 comments on commit d17bd4b

Please sign in to comment.