-
Notifications
You must be signed in to change notification settings - Fork 40
/
test.config.js
52 lines (47 loc) · 1.22 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
require("regenerator-runtime/runtime")
require("@babel/register")({
extensions: [".js", ".jsx", ".mjs", ".ts", ".tsx"],
})
require("coffeescript/register")
require("raf/polyfill")
require("should")
require("dotenv").config({
path: require("path").join(process.cwd(), ".env.test"),
})
const $ = require("jquery")
const Adapter = require("enzyme-adapter-react-16")
const Enzyme = require("enzyme")
const React = require("react")
const DOM = require("react-dom-factories")
const createClass = require("create-react-class")
const sd = require("sharify")
const {
FeatureArticle,
} = require("@artsy/reaction/dist/Components/Publishing/Fixtures/Articles")
// Patch React 16 with deprecated helpers
React.DOM = DOM
React.createClass = createClass
Enzyme.configure({
adapter: new Adapter(),
})
try {
global.$ = global.jQuery = $
window.innerHeight = 900
window.innerWidth = 1400
window.scrollY = 200
window.scrollTo = () => {}
window.matchMedia =
window.matchMedia ||
function() {
return {
matches: false,
addListener: function() {},
removeListener: function() {},
}
}
} catch (error) {}
sd.data = {
ARTICLE: FeatureArticle,
CHANNEL: {},
USER: { id: "57b5fc6acd530e65f8000406" },
}