UNPKG

672 BJavaScriptView Raw
1// @remove-on-eject-begin
2/**
3 * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * LICENSE file in the root directory of this source tree. An additional grant
7 * of patent rights can be found in the PATENTS file in the same directory.
8 */
9// @remove-on-eject-end
10'use strict';
11
12const path = require('path');
13
14// This is a custom Jest transformer turning file imports into filenames.
15// http://facebook.github.io/jest/docs/tutorial-webpack.html
16
17module.exports = {
18 process(src, filename) {
19 return 'module.exports = ' + JSON.stringify(path.basename(filename)) + ';';
20 },
21};