1 | require('raf').polyfill(global)
|
2 | global.DEBUG = process.env.DEBUG || process.env.debug
|
3 |
|
4 | global.subscribe = null
|
5 | global.serverModel = null
|
6 | global.Simple = null
|
7 | global.Complex = null
|
8 | global.model = null
|
9 | global.subDoc = null
|
10 | global.subQuery = null
|
11 | global.subLocal = null
|
12 | global.subValue = null
|
13 | global.subApi = null
|
14 | global.HooksComplex = null
|
15 | global.HooksSimple = null
|
16 | global.useDoc = null
|
17 | global.useQuery = null
|
18 | global.useLocal = null
|
19 | global.useValue = null
|
20 | global.useApi = null
|
21 |
|
22 | global.globalTestRenderer = null
|
23 | global.globalEnzymeNode = null
|
24 |
|
25 | export function asyncImport () {
|
26 | global.serverModel = require('./_client/initRpc')
|
27 | global.subscribe = require('..').subscribe
|
28 | global.model = require('..').model
|
29 | global.Simple = require('./stubs/Simple')
|
30 | global.Complex = require('./stubs/Complex')
|
31 | global.subValue = require('..').subValue
|
32 | global.subDoc = require('..').subDoc
|
33 | global.subQuery = require('..').subQuery
|
34 | global.subLocal = require('..').subLocal
|
35 | global.subApi = require('..').subApi
|
36 | global.HooksComplex = require('./stubs/HooksComplex')
|
37 | global.HooksSimple = require('./stubs/HooksSimple')
|
38 | global.useValue = require('..').useValue
|
39 | global.useDoc = require('..').useDoc
|
40 | global.useQuery = require('..').useQuery
|
41 | global.useLocal = require('..').useLocal
|
42 | global.useApi = require('..').useApi
|
43 | }
|
44 |
|
45 | export function cleanup () {
|
46 | if (global.globalEnzymeNode && global.globalEnzymeNode.unmount) {
|
47 | global.globalEnzymeNode.unmount()
|
48 | global.globalEnzymeNode = undefined
|
49 | }
|
50 | if (global.globalTestRenderer && global.globalTestRenderer.unmount) {
|
51 | global.globalTestRenderer.unmount()
|
52 | global.globalTestRenderer = undefined
|
53 | }
|
54 | }
|