Skip to content

Commit b48aeb8

Browse files
authored
Merge pull request #60 from canjs/landscaper/qunit2
Landscaper: QUnit2 upgrade
2 parents 8b76534 + 566cc0a commit b48aeb8

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"http-server": "^0.11.0",
4343
"jshint": "^2.9.5",
4444
"steal": "^1.5.14",
45-
"steal-qunit": "^1.0.0",
45+
"steal-qunit": "^2.0.0",
4646
"steal-tools": "^1.9.0",
4747
"testee": "^0.9.0"
4848
},

test.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ defineValidate(NoConstraints);
2929

3030
QUnit.module("can-define-validate-validatejs");
3131

32-
QUnit.test("when constraints missing", function() {
32+
QUnit.test("when constraints missing", function(assert) {
3333
var locator = new NoConstraints();
34-
QUnit.notOk(locator.errors(), "runs but returns no errors");
34+
assert.notOk(locator.errors(), "runs but returns no errors");
3535
});
3636

37-
QUnit.test("errors is readable when wrapped as compute", function() {
37+
QUnit.test("errors is readable when wrapped as compute", function(assert) {
3838
var locator = new Locator({ city: "angier", state: "NC" });
3939
var errors = compute(function() {
4040
return locator.errors();
@@ -50,7 +50,7 @@ QUnit.test("errors is readable when wrapped as compute", function() {
5050
}
5151
];
5252
errors.on("change", function(ev, errors) {
53-
QUnit.deepEqual(
53+
assert.deepEqual(
5454
errors,
5555
expectedErrors,
5656
"Errors are set based on constraints"
@@ -60,15 +60,15 @@ QUnit.test("errors is readable when wrapped as compute", function() {
6060
locator.state = "Juan";
6161
});
6262

63-
QUnit.test("errors is readable when wrapped as compute", function() {
63+
QUnit.test("errors is readable when wrapped as compute", function(assert) {
6464
var locator = new Locator({ city: "angier", state: "NC", zipCode: 27501 });
6565
var errors = compute(function() {
6666
return locator.errors();
6767
});
6868
var counter = 0;
6969
errors.on("change", function(ev, errors) {
7070
if (counter > 0) {
71-
QUnit.notOk(errors, "Errors update when values change");
71+
assert.notOk(errors, "Errors update when values change");
7272
}
7373
counter++;
7474
});
@@ -77,7 +77,7 @@ QUnit.test("errors is readable when wrapped as compute", function() {
7777
locator.state = "CA";
7878
});
7979

80-
QUnit.test("calling errors returns object", function() {
80+
QUnit.test("calling errors returns object", function(assert) {
8181
var locator = new Locator({ city: "angier" });
8282
var expectedErrors = [
8383
{
@@ -89,13 +89,13 @@ QUnit.test("calling errors returns object", function() {
8989
related: ["zipCode"]
9090
}
9191
];
92-
QUnit.deepEqual(locator.errors(), expectedErrors, "Returns error type array");
92+
assert.deepEqual(locator.errors(), expectedErrors, "Returns error type array");
9393
});
9494

95-
QUnit.test("calling errors with string returns error for that key", function() {
95+
QUnit.test("calling errors with string returns error for that key", function(assert) {
9696
var locator = new Locator({ city: "angier" });
9797
var errors = locator.errors("state");
98-
QUnit.deepEqual(errors, [
98+
assert.deepEqual(errors, [
9999
{
100100
message: "can't be blank",
101101
related: ["state"]
@@ -105,14 +105,14 @@ QUnit.test("calling errors with string returns error for that key", function() {
105105

106106
QUnit.test(
107107
"calling errors with string returns undefined when no errors are set",
108-
function() {
108+
function(assert) {
109109
var locator = new Locator({ city: "angier", state: "NC", zipCode: 27501 });
110110
var errors = locator.errors("state");
111-
QUnit.notOk(errors, "Errors is undefined");
111+
assert.notOk(errors, "Errors is undefined");
112112
}
113113
);
114114

115-
QUnit.test("errors with object returns errors for requested keys", function() {
115+
QUnit.test("errors with object returns errors for requested keys", function(assert) {
116116
var locator = new Locator({ city: "angier" });
117117
var expectedErrors = [
118118
{
@@ -124,10 +124,10 @@ QUnit.test("errors with object returns errors for requested keys", function() {
124124
related: ["zipCode"]
125125
}
126126
];
127-
QUnit.deepEqual(locator.errors("state", "zipCode"), expectedErrors);
127+
assert.deepEqual(locator.errors("state", "zipCode"), expectedErrors);
128128
});
129129

130-
QUnit.test("testSet a single value", function() {
130+
QUnit.test("testSet a single value", function(assert) {
131131
var locator = new Locator({ city: "angier", state: "nc", zipCode: 27501 });
132132
var expectedErrors = [
133133
{
@@ -140,11 +140,11 @@ QUnit.test("testSet a single value", function() {
140140
}
141141
];
142142
var errors = locator.testSet("state", "");
143-
QUnit.deepEqual(errors, expectedErrors, "returns correct error");
144-
QUnit.notOk(locator.errors(), "Does not set errors on map");
143+
assert.deepEqual(errors, expectedErrors, "returns correct error");
144+
assert.notOk(locator.errors(), "Does not set errors on map");
145145
});
146146

147-
QUnit.test("testSet many values", function() {
147+
QUnit.test("testSet many values", function(assert) {
148148
var locator = new Locator({ city: "angier", state: "nc", zipCode: 27501 });
149149
var errors = locator.testSet({ state: "", zipCode: "" });
150150
var expectedErrors = [
@@ -165,11 +165,11 @@ QUnit.test("testSet many values", function() {
165165
related: ["zipCode"]
166166
}
167167
];
168-
QUnit.deepEqual(errors, expectedErrors, "returns correct error");
169-
QUnit.notOk(locator.errors(), "Does not set errors on map");
168+
assert.deepEqual(errors, expectedErrors, "returns correct error");
169+
assert.notOk(locator.errors(), "Does not set errors on map");
170170
});
171171

172-
QUnit.test("testSet many values, with clean map", function() {
172+
QUnit.test("testSet many values, with clean map", function(assert) {
173173
var locator = new Locator({ city: "angier", state: "nc", zipCode: 27501 });
174174
var errors = locator.testSet({ state: "" }, true);
175175
var expectedErrors = [
@@ -190,6 +190,6 @@ QUnit.test("testSet many values, with clean map", function() {
190190
related: ["zipCode"]
191191
}
192192
];
193-
QUnit.deepEqual(errors, expectedErrors, "returns correct error");
194-
QUnit.notOk(locator.errors(), "Does not set errors on map");
193+
assert.deepEqual(errors, expectedErrors, "returns correct error");
194+
assert.notOk(locator.errors(), "Does not set errors on map");
195195
});

0 commit comments

Comments
 (0)