fileTransform.js 301 B

1234567891011
  1. const path = require('path');
  2. // This is a custom Jest transformer turning file imports into filenames.
  3. // http://facebook.github.io/jest/docs/tutorial-webpack.html
  4. module.exports = {
  5. process(src, filename) {
  6. return 'module.exports = ' + JSON.stringify(path.basename(filename)) + ';';
  7. },
  8. };