fileTransform.js 538 Bytes
Newer Older
1
// @remove-on-eject-begin
Christoph Pojer's avatar
Christoph Pojer committed
2
/**
Sophie Alpert's avatar
Sophie Alpert committed
3
 * Copyright (c) 2014-present, Facebook, Inc.
Christoph Pojer's avatar
Christoph Pojer committed
4
 *
Sophie Alpert's avatar
Sophie Alpert committed
5
6
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
Christoph Pojer's avatar
Christoph Pojer committed
7
 */
8
// @remove-on-eject-end
9
'use strict';
Christoph Pojer's avatar
Christoph Pojer committed
10

11
12
13
const path = require('path');

// This is a custom Jest transformer turning file imports into filenames.
vannio's avatar
vannio committed
14
// http://facebook.github.io/jest/docs/en/webpack.html
15
16
17

module.exports = {
  process(src, filename) {
18
    return `module.exports = ${JSON.stringify(path.basename(filename))};`;
19
20
  },
};