mirror of
https://github.com/ansible/awx.git
synced 2026-03-07 11:41:08 -03:30
update file mock to return file name
This commit is contained in:
@@ -1 +1,7 @@
|
|||||||
module.exports = 'test-file-stub';
|
const path = require('path');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
process (src, filename) {
|
||||||
|
return `module.exports=${JSON.stringify(path.basename(filename))};`;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ module.exports = {
|
|||||||
'src/**/*.{js,jsx}'
|
'src/**/*.{js,jsx}'
|
||||||
],
|
],
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/__mocks__/fileMock.js',
|
|
||||||
'\\.(css|scss|less)$': '<rootDir>/__mocks__/styleMock.js'
|
'\\.(css|scss|less)$': '<rootDir>/__mocks__/styleMock.js'
|
||||||
},
|
},
|
||||||
setupTestFrameworkScriptFile: '<rootDir>/jest.setup.js',
|
setupTestFrameworkScriptFile: '<rootDir>/jest.setup.js',
|
||||||
@@ -13,7 +12,8 @@ module.exports = {
|
|||||||
testEnvironment: 'jsdom',
|
testEnvironment: 'jsdom',
|
||||||
testURL: 'http://127.0.0.1:3001',
|
testURL: 'http://127.0.0.1:3001',
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.(js|jsx)$': 'babel-jest'
|
'^.+\\.(js|jsx)$': 'babel-jest',
|
||||||
|
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/__mocks__/fileMock.js',
|
||||||
},
|
},
|
||||||
transformIgnorePatterns: [
|
transformIgnorePatterns: [
|
||||||
'[/\\\\]node_modules[/\\\\].+\\.(?!(axios)/)(js|jsx)$'
|
'[/\\\\]node_modules[/\\\\].+\\.(?!(axios)/)(js|jsx)$'
|
||||||
|
|||||||
Reference in New Issue
Block a user