forked from artsy/force
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.config.js
54 lines (44 loc) · 1.28 KB
/
test.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
const sd = require("sharify").data
require("@babel/register")({
extensions: [".ts", ".js", ".tsx", ".jsx"],
})
require("coffeescript/register")
// FIXME: Do we need this?
// NOTE: Once we do AOT compilation we probably want to re-enable this on the server in development mode only.
// require('source-map-support/register')
const path = require("path")
const Adapter = require('@wojtekmaj/enzyme-adapter-react-17')
const Enzyme = require("enzyme")
// TODO: Look into why this bumps user off of other node command-line tab
require("dotenv").config({
path: path.join(process.cwd(), ".env.test"),
})
Enzyme.configure({
adapter: new Adapter(),
})
try {
window.matchMedia =
window.matchMedia ||
function() {
return {
matches: false,
addListener: function() {},
removeListener: function() {},
}
}
window.alert =
window.alert ||
function(msg) {
console.log(msg)
}
window.scrollTo = window.scrollTo || function() {}
} catch (error) {}
// Used for Acceptance tests
require("raf/polyfill")
require("should")
require("./src/lib/jade_hook")
// Used by relay
sd.METAPHYSICS_ENDPOINT = "http://localhost:5003"
global.$ = require("jquery")
// https://jestjs.io/docs/en/troubleshooting#unresolved-promises
global.Promise = require("promise")