Skip to content

Commit 98ff6b4

Browse files
authored
Merge pull request #44 from canjs/landscaper/qunit2
Landscaper: QUnit2 upgrade
2 parents 0f6e70a + a1bcbc0 commit 98ff6b4

25 files changed

+510
-510
lines changed

can-query-logic-test.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ QUnit.module("can-query-logic");
2828

2929

3030

31-
QUnit.test("union", function() {
31+
QUnit.test("union", function(assert) {
3232
var unionResult = algebra.union({
3333
filter: {
3434
name: "Ramiya"
@@ -39,7 +39,7 @@ QUnit.test("union", function() {
3939
}
4040
});
4141

42-
QUnit.deepEqual(unionResult, {
42+
assert.deepEqual(unionResult, {
4343
filter: {
4444
name: {
4545
$in: ["Ramiya", "Bohdi"]
@@ -48,7 +48,7 @@ QUnit.test("union", function() {
4848
});
4949
});
5050

51-
QUnit.test("difference", function() {
51+
QUnit.test("difference", function(assert) {
5252
var differenceResult = algebra.difference({
5353
filter: {
5454
name: {
@@ -61,7 +61,7 @@ QUnit.test("difference", function() {
6161
}
6262
});
6363

64-
QUnit.deepEqual(differenceResult, {
64+
assert.deepEqual(differenceResult, {
6565
filter: {
6666
name: "Ramiya",
6767
}
@@ -70,7 +70,7 @@ QUnit.test("difference", function() {
7070

7171
});
7272

73-
QUnit.test("subset", function() {
73+
QUnit.test("subset", function(assert) {
7474
var subsetResult = algebra.isSubset({
7575
filter: {
7676
name: "Bohdi"
@@ -83,10 +83,10 @@ QUnit.test("subset", function() {
8383
}
8484
});
8585

86-
QUnit.deepEqual(subsetResult, true);
86+
assert.deepEqual(subsetResult, true);
8787
});
8888

89-
QUnit.test("isMember", function() {
89+
QUnit.test("isMember", function(assert) {
9090
var hasResult = algebra.isMember({
9191
filter: {
9292
name: "Bohdi"
@@ -95,10 +95,10 @@ QUnit.test("isMember", function() {
9595
name: "Bohdi"
9696
});
9797

98-
QUnit.deepEqual(hasResult, true);
98+
assert.deepEqual(hasResult, true);
9999
});
100100

101-
QUnit.test("filterMembers basics", function() {
101+
QUnit.test("filterMembers basics", function(assert) {
102102
var subset = algebra.filterMembers({
103103
filter: {
104104
name: {
@@ -119,7 +119,7 @@ QUnit.test("filterMembers basics", function() {
119119
}
120120
]);
121121

122-
QUnit.deepEqual(subset, [{
122+
assert.deepEqual(subset, [{
123123
name: "Bohdi"
124124
},
125125
{
@@ -151,7 +151,7 @@ QUnit.test("filterMembers basics", function() {
151151
}
152152
]);
153153

154-
QUnit.deepEqual(subset, [{
154+
assert.deepEqual(subset, [{
155155
name: "Payal"
156156
},
157157
{
@@ -161,7 +161,7 @@ QUnit.test("filterMembers basics", function() {
161161
});
162162

163163

164-
QUnit.test("unionMembers basics", function() {
164+
QUnit.test("unionMembers basics", function(assert) {
165165
var union = algebra.unionMembers({
166166
filter: {
167167
name: "Bohdi"
@@ -178,7 +178,7 @@ QUnit.test("unionMembers basics", function() {
178178
id: 2
179179
}, ]);
180180

181-
QUnit.deepEqual(union, [{
181+
assert.deepEqual(union, [{
182182
name: "Bohdi",
183183
id: 1
184184
},
@@ -189,10 +189,10 @@ QUnit.test("unionMembers basics", function() {
189189
]);
190190
});
191191

192-
QUnit.test("count basics", function() {
192+
QUnit.test("count basics", function(assert) {
193193

194-
QUnit.equal(algebra.count({}), Infinity);
195-
QUnit.equal(algebra.count({
194+
assert.equal(algebra.count({}), Infinity);
195+
assert.equal(algebra.count({
196196
page: {
197197
start: 1,
198198
end: 2
@@ -202,7 +202,7 @@ QUnit.test("count basics", function() {
202202

203203
});
204204

205-
QUnit.test('index basics', function() {
205+
QUnit.test('index basics', function(assert) {
206206

207207
var index = algebra.index({
208208
sort: "name"
@@ -222,7 +222,7 @@ QUnit.test('index basics', function() {
222222
}], {
223223
name: "k"
224224
});
225-
equal(index, 2);
225+
assert.equal(index, 2);
226226

227227
index = algebra.index({
228228
sort: "-name"
@@ -242,7 +242,7 @@ QUnit.test('index basics', function() {
242242
}].reverse(), {
243243
name: "k"
244244
});
245-
equal(index, 2);
245+
assert.equal(index, 2);
246246

247247
index = algebra.index({},
248248
[{
@@ -262,7 +262,7 @@ QUnit.test('index basics', function() {
262262
name: "k"
263263
});
264264

265-
equal(index, 0);
265+
assert.equal(index, 0);
266266

267267

268268
index = algebra.index({},
@@ -282,7 +282,7 @@ QUnit.test('index basics', function() {
282282
name: "k"
283283
});
284284

285-
equal(index, undefined, "no value if no id");
285+
assert.equal(index, undefined, "no value if no id");
286286

287287
var TODO_id = canReflect.assignSymbols({}, {
288288
"can.getSchema": function() {
@@ -318,13 +318,13 @@ QUnit.test('index basics', function() {
318318
_id: 2
319319
});
320320

321-
equal(index, 2);
321+
assert.equal(index, 2);
322322

323323
//var algebra = new set.Algebra(set.props.id("id"));
324324

325325
});
326326

327-
QUnit.test("filterMembers with reverse sort", function() {
327+
QUnit.test("filterMembers with reverse sort", function(assert) {
328328
var sortedMembers = algebra.filterMembers({
329329
sort: "-name"
330330
},
@@ -342,7 +342,7 @@ QUnit.test("filterMembers with reverse sort", function() {
342342
name: "s"
343343
}]);
344344

345-
QUnit.deepEqual(sortedMembers,
345+
assert.deepEqual(sortedMembers,
346346
[{
347347
id: 2,
348348
name: "z"
@@ -409,11 +409,11 @@ QUnit.test("Value returned by makeEnum is constructorLike", function(assert) {
409409
assert.ok(pass, "Status is constructor like");
410410
});
411411

412-
QUnit.test("can call low-level APIs from the outside", function() {
412+
QUnit.test("can call low-level APIs from the outside", function(assert) {
413413
var gt1 = new QueryLogic.GreaterThan(1);
414414
var lte1 = new QueryLogic.LessThanEqual(1);
415415

416-
QUnit.equal(QueryLogic.intersection(gt1, lte1), QueryLogic.EMPTY);
416+
assert.equal(QueryLogic.intersection(gt1, lte1), QueryLogic.EMPTY);
417417

418418

419419
var isGtJustinAndGt35 = new QueryLogic.KeysAnd({
@@ -424,6 +424,6 @@ QUnit.test("can call low-level APIs from the outside", function() {
424424
age: new QueryLogic.GreaterThan(25)
425425
});
426426

427-
QUnit.deepEqual(QueryLogic.union(isGtJustinAndGt35, isGt25), isGt25, "fewer clauses");
427+
assert.deepEqual(QueryLogic.union(isGtJustinAndGt35, isGt25), isGt25, "fewer clauses");
428428

429429
});

compat/prop_tests/boolean_test.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ QUnit.module("can-set compat props.boolean");
1414
*
1515
*
1616
*/
17-
test('boolean set.difference', function() {
17+
QUnit.test('boolean set.difference', function(assert) {
1818

1919
var prop = props.boolean('completed');
2020

@@ -25,7 +25,7 @@ test('boolean set.difference', function() {
2525
* z ∈ (X / Y) | y.completed = false
2626
*/
2727
var res = set.difference({} , { completed: true }, prop);
28-
deepEqual(res, {completed: false}, "inverse of true");
28+
assert.deepEqual(res, {completed: false}, "inverse of true");
2929

3030
/*
3131
* x ∈ {} | x.completed = true OR x.completed = false
@@ -34,7 +34,7 @@ test('boolean set.difference', function() {
3434
* z ∈ (X / Y) | y.completed = false
3535
*/
3636
res = set.difference({}, { completed: false }, prop);
37-
deepEqual(res, {completed: true} , "inverse of false");
37+
assert.deepEqual(res, {completed: true} , "inverse of false");
3838
});
3939

4040
/*
@@ -44,10 +44,10 @@ test('boolean set.difference', function() {
4444
*
4545
* (X U Y) = c
4646
*/
47-
test('boolean set.union', function(){
47+
QUnit.test('boolean set.union', function(assert) {
4848
var prop = props.boolean('completed');
4949
var res = set.union({completed: false} , { completed: true }, prop);
50-
deepEqual(res, {}, "union of true and false is entire boolean set");
50+
assert.deepEqual(res, {}, "union of true and false is entire boolean set");
5151
});
5252

5353
/*
@@ -69,31 +69,31 @@ test('boolean set.union', function(){
6969
*
7070
* Only requires that one property is always on an element
7171
*/
72-
test('boolean set.intersection', function(){
72+
QUnit.test('boolean set.intersection', function(assert) {
7373
var prop = props.boolean('completed');
7474
var res = set.intersection({foo: "bar"} , { completed: true }, prop);
75-
deepEqual(res, {foo: "bar", completed: true}, "intersection is false (#4)");
75+
assert.deepEqual(res, {foo: "bar", completed: true}, "intersection is false (#4)");
7676
});
7777

7878

79-
test('strings false and true are treated as booleans', function(){
79+
QUnit.test('strings false and true are treated as booleans', function(assert) {
8080
var prop = props.boolean('completed');
8181
var res;
8282

8383
res = set.isSubset({} , { completed: "true" }, prop);
84-
ok(!res, "{} and 'true' not a subset");
84+
assert.ok(!res, "{} and 'true' not a subset");
8585
res = set.isSubset({} , { completed: "false" }, prop);
86-
ok(!res, "{} and 'false' not a subset");
86+
assert.ok(!res, "{} and 'false' not a subset");
8787

8888
res = set.isSubset({ completed: "true" }, {}, prop);
89-
ok(res, "subset");
89+
assert.ok(res, "subset");
9090

9191
res = set.isSubset({ completed: "false" }, {}, prop);
92-
ok(res, "subset");
92+
assert.ok(res, "subset");
9393

9494
res = set.union({completed: 'false'} , { completed: 'true' }, prop);
95-
deepEqual(res, {}, "union of true and false is entire boolean set");
95+
assert.deepEqual(res, {}, "union of true and false is entire boolean set");
9696

9797
res = set.isEqual({completed: false} , { completed: "false" }, prop);
98-
ok(res, "false and 'false'");
98+
assert.ok(res, "false and 'false'");
9999
});

compat/prop_tests/dotNotation_test.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ QUnit.module("can-set props.dotNotation");
1212
* x ∈ X | x.n.p = 'IL'
1313
*
1414
*/
15-
test('dotNotation set membership', function() {
15+
QUnit.test('dotNotation set membership', function(assert) {
1616
/*
1717
* For a property 'n.p', with value 'IL'
1818
* x ∈ X | x.n.p == 'IL'
1919
*/
2020
var prop = props.dotNotation('n.p'),
2121
alg = new set.Algebra(prop),
2222
res = alg.isMember({'n.p': 'IL'}, {n:{p:'IL'}});
23-
ok(res, "object with nested property is member of set using dotNotation");
23+
assert.ok(res, "object with nested property is member of set using dotNotation");
2424

2525
/*
2626
* For a property 'n.p', with value 'IL'
2727
* x ∉ X | x.n.p != 'IL'
2828
*/
2929
res = alg.isMember({'n.p': 'IL'}, {n:{p:'MI'}});
30-
ok(res === false, "object with nested property not a member of set using dotNotation");
30+
assert.ok(res === false, "object with nested property not a member of set using dotNotation");
3131

3232
/*
3333
* For a property 'n.p.s', with value 'IL'
@@ -36,10 +36,10 @@ test('dotNotation set membership', function() {
3636
prop = props.dotNotation('n.p.s');
3737
alg = new set.Algebra(prop);
3838
res = alg.isMember({'n.p.s': 'IL'}, {n:{p:{s:'IL'}}});
39-
ok(res, "object with deep nested property is member of set using dotNotation");
39+
assert.ok(res, "object with deep nested property is member of set using dotNotation");
4040
});
4141

42-
test('dotNotation set equality', function() {
42+
QUnit.test('dotNotation set equality', function(assert) {
4343
var prop = props.dotNotation('n.p'),
4444
alg = new set.Algebra(prop),
4545
set1 = {'n.p': 'IL'},
@@ -50,20 +50,20 @@ test('dotNotation set equality', function() {
5050
/*
5151
* {x | x ∈ X, x.n.p == 'IL'} = {y | y ∈ Y, y.n.p == 'IL'}
5252
*/
53-
ok(alg.equal(set1, set2) && alg.equal(set2, set1), "sets with dotNotation properties are equivalent");
53+
assert.ok(alg.equal(set1, set2) && alg.equal(set2, set1), "sets with dotNotation properties are equivalent");
5454

5555
/*
5656
* {x | x ∈ X, x.n.p == 'IL'} != {y | y ∈ Y, y.n.p == 'MI'}
5757
*/
58-
ok(alg.equal(set1, set3) === false, "sets with dotNotation properties are not equivalent");
58+
assert.ok(alg.equal(set1, set3) === false, "sets with dotNotation properties are not equivalent");
5959

6060
/*
6161
* {x | x ∈ X, x.n.p == 'MI'} = {y | y ∈ Y, y.n.p == 'MI'}
6262
*/
63-
ok(alg.equal(set4, set3) === false, "sets with dotNotation properties are equivalent to sets with nested properties");
63+
assert.ok(alg.equal(set4, set3) === false, "sets with dotNotation properties are equivalent to sets with nested properties");
6464
});
6565

66-
test('dotNotation set subset', function() {
66+
QUnit.test('dotNotation set subset', function(assert) {
6767
var alg = new set.Algebra(
6868
props.dotNotation('address.state'),
6969
props.dotNotation('address.city')
@@ -75,20 +75,20 @@ test('dotNotation set subset', function() {
7575
/*
7676
* {x | x ∈ X, x.address.state = 'IL', x.address.city = 'Chicago'} ⊆ {y | y ∈ Y, y.address.state == 'IL'}
7777
*/
78-
ok(alg.subset(set2, set1), "sets with dotNotation property is a subset of another dotNotation set");
78+
assert.ok(alg.subset(set2, set1), "sets with dotNotation property is a subset of another dotNotation set");
7979

8080
/*
8181
* {x | x ∈ X, x.address.state = 'IL', x.address.city = 'Chicago'} ⊆ {y | y ∈ Y, y.address.state == 'IL'}
8282
*/
83-
ok(alg.subset(set3, set1), "sets with nested property notation is a subset of a dotNotation set");
83+
assert.ok(alg.subset(set3, set1), "sets with nested property notation is a subset of a dotNotation set");
8484

8585
/*
8686
* {y | y ∈ Y, y.address.state == 'IL'} ⊆ ξ
8787
*/
88-
ok(alg.subset(set1, {}), "sets with dotNotation properties are subsets of the universal set");
88+
assert.ok(alg.subset(set1, {}), "sets with dotNotation properties are subsets of the universal set");
8989

9090
/*
9191
* ξ ⊄ {y | y ∈ Y, y.address.state == 'IL'}
9292
*/
93-
ok(alg.subset({}, set1) === false, "the universal set is not a subset of a set with dotNotation");
93+
assert.ok(alg.subset({}, set1) === false, "the universal set is not a subset of a set with dotNotation");
9494
});

0 commit comments

Comments
 (0)