Last active
October 11, 2017 21:01
-
-
Save mateuszsokola/f51f0a8c1d6ade78de4935a64a71d6d1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Transpiles TypeScript to JavaScript code. | |
* | |
* @link https://github.com/facebook/jest/blob/master/examples/typescript/preprocessor.js | |
* @copyright 2004-present Facebook. All Rights Reserved. | |
*/ | |
const tsc = require('typescript'); | |
const tsConfig = require('./tsconfig.json'); | |
module.exports = { | |
process(src, path) { | |
if (path.endsWith('.ts') || path.endsWith('.tsx') || path.endsWith('.js')) { | |
return tsc.transpile(src, tsConfig.compilerOptions, path, []); | |
} | |
return src; | |
}, | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Defines the React 16 Adapter for Enzyme. | |
* | |
* @link http://airbnb.io/enzyme/docs/installation/#working-with-react-16 | |
* @copyright 2017 Airbnb, Inc. | |
*/ | |
const enzyme = require("enzyme"); | |
const Adapter = require("enzyme-adapter-react-16"); | |
enzyme.configure({ adapter: new Adapter() }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get rids of the missing requestAnimationFrame polyfill warning. | |
* | |
* @link https://reactjs.org/docs/javascript-environment-requirements.html | |
* @copyright 2004-present Facebook. All Rights Reserved. | |
*/ | |
global.requestAnimationFrame = function(callback) { | |
setTimeout(callback, 0); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment