safe-react/config/jest/fileTransform.js

11 lines
293 B
JavaScript
Raw Normal View History

2019-05-29 14:11:44 +00:00
const path = require('path')
2018-03-01 08:05:56 +00:00
// This is a custom Jest transformer turning file imports into filenames.
// http://facebook.github.io/jest/docs/tutorial-webpack.html
module.exports = {
process(src, filename) {
2019-05-29 14:11:44 +00:00
return `module.exports = ${JSON.stringify(path.basename(filename))};`
2018-03-01 08:05:56 +00:00
},
2019-05-29 14:11:44 +00:00
}