mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-07 22:37:55 +08:00
* Let Jest handle all file types * Update regexes * Fix exclusion regex to also exclude files without extension * Be over-cautious with Windows paths because I'm not sure how Jest handles them * There is no automatic babel-jest discovery now that we use transsform
21 lines
658 B
JavaScript
21 lines
658 B
JavaScript
// @remove-on-eject-begin
|
|
/**
|
|
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
// @remove-on-eject-end
|
|
|
|
const path = require('path');
|
|
|
|
// 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) {
|
|
return 'module.exports = ' + JSON.stringify(path.basename(filename)) + ';';
|
|
},
|
|
};
|