-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathtest.js
55 lines (41 loc) · 1.56 KB
/
test.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
// Run `node --inspect --inspect-brk test.js`, open the debugger, and check everything renders correctly
var Immutable4 = require("immutable");
var Immutable3 = require("immutable3");
var installDevTools = require("./dist");
installDevTools(Immutable4);
console.log("Testing with Immutable 4")
runTests(Immutable4)
console.log("Testing with Immutable 3")
runTests(Immutable3)
debugger
function runTests(Immutable) {
class ABRecord extends Immutable.Record({a:1,b:2}) {
getAB() {
return this.a + this.b;
}
}
console.log("Record object itself, not a record instance - make sure there are no errors", ABRecord)
var Xyz = new Immutable.Map({a: new Immutable.Map({b:8})})
console.log("Expand this and check child renders as a Map", Xyz)
var Foo = Immutable.Record({bar: new Immutable.Map({a: 5}) })
var f = Foo()
console.log("Expand this and check child renders as a Map", f)
var record = new ABRecord();
var record2 = new ABRecord({a: 2});
console.log(record);
console.log(record2);
var orderedMap = Immutable.OrderedMap({key: "value"});
var orderedMap2 = Immutable.OrderedMap([["key", "value"], ["key2", "value2"]]);
console.log(orderedMap);
console.log(orderedMap2);
var orderedSet = Immutable.OrderedSet(["hello", "aaa"]);
console.log(orderedSet);
var list = Immutable.List(["hello", "world"]);
console.log(list)
var map = Immutable.Map({hello: "world"})
console.log(map)
var set = Immutable.Set(["hello", "aaa"])
console.log(set)
var stack = Immutable.Stack(["hello", "aaa"])
console.log(stack)
}