-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample.js
94 lines (91 loc) · 1.46 KB
/
sample.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
var sw33t = require('./sw33t');
var assert = require('chai').assert;
var spec = {
subjects: {
the_subject: {}
},
"Name of subject": {
"Parent 1": {
subjects: {
the_subject: {
Age: 21
}
},
tests: {
"should be `Alex`": {
subjects: {
the_subject: {
Name: "Alex"
}
},
note: "sample",
alias: "nameTest",
expects: {
equal: "Alex"
}
},
"should be `Sarah`": {
subjects: {
the_subject: {
Name: "Sarah"
}
},
note: "sample",
alias: "nameTest",
expects: {
equal: "Sarah"
}
},
"should be `21`": {
alias: "ageTest",
expects: {
equal: 21
}
}
}
},
"Parent 2": {
tests: {
"should be `Alex`": {
subjects: {
the_subject: {
Name: "Alex"
}
},
note: "sample",
alias: "nameTest",
expects: {
equal: "Alex"
}
},
"should be `Sarah`": {
subjects: {
the_subject: {
Name: "Sarah"
}
},
note: "sample",
alias: "nameTest",
expects: {
equal: "Sarah"
}
},
"should be `21`": {
alias: "ageTest",
expects: {
equal: 21
}
}
}
}
}
};
var tests = {
"nameTest": function(subject, expects) {
assert.equal(subject.the_subject.Name, expects.equal);
},
"ageTest": function(subject, expects) {
assert.equal(subject.the_subject.Age, expects.equal);
}
};
sw33t.run(spec, tests);