-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
api.js
74 lines (72 loc) · 1.94 KB
/
api.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import * as fs from "fs"
var mobx = require("../../src/mobx.ts")
test("correct api should be exposed", function() {
expect(
Object.keys(mobx)
.filter(key => mobx[key] !== undefined)
.sort()
).toEqual(
[
"$mobx", // adminstration symbol
"action",
"_allowStateChanges",
"_allowStateChangesInsideComputed",
"autorun",
"comparer",
"computed",
"configure",
"createAtom",
"decorate",
"extendObservable",
"flow",
"castFlowReturn",
"get",
"_getAdministration",
"getAtom",
"getDebugName",
"getDependencyTree",
"has",
"_getGlobalState",
"getObserverTree",
"IDerivationState",
"intercept",
"_interceptReads",
"isAction",
"isArrayLike",
"isBoxedObservable",
"isComputed",
"isComputedProp",
"_isComputingDerivation",
"isObservable",
"isObservableArray",
"isObservableMap",
"isObservableObject",
"isObservableProp",
"keys",
"ObservableMap",
"observable",
"observe",
"onReactionError",
"onBecomeObserved",
"onBecomeUnobserved",
"Reaction",
"reaction",
"remove",
"_resetGlobalState",
"runInAction",
"set",
"spy",
"toJS",
"trace",
"transaction",
"untracked",
"values",
"entries",
"when"
].sort()
)
})
test("mobx has no dependencies", () => {
const pkg = JSON.parse(fs.readFileSync(__dirname + "/../../package.json", "utf8"))
expect(pkg.dependencies).toEqual({})
})