Skip to content

Commit c6af09c

Browse files
committed
chore: replaces with assert.strictEqual
- runs yarn lint:fix
1 parent 82e416d commit c6af09c

File tree

4 files changed

+40
-27
lines changed

4 files changed

+40
-27
lines changed

.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ module.exports = {
2222
env: {
2323
browser: true,
2424
},
25+
globals: {
26+
require: true,
27+
beforeEach: true,
28+
it: true,
29+
describe: true,
30+
afterEach: true,
31+
process: true,
32+
module: true,
33+
},
2534
rules: {
2635
'ember/no-new-mixins': 'off',
2736
'ember/no-jquery': 'error',

tests/acceptance/root-test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ module('Acceptance: Root', function (hooks) {
2828

2929
await visit('/');
3030

31-
assert.equal(currentRouteName(), 'index');
32-
assert.equal(
31+
assert.strictEqual(currentRouteName(), 'index');
32+
assert.strictEqual(
3333
this.element.querySelector('.fetch').textContent.trim(),
3434
'Hello World! fetch'
3535
);
3636
});
3737

3838
test('posting a string', function (assert) {
3939
server.post('/upload', function (req) {
40-
assert.equal(req.requestBody, 'foo');
40+
assert.strictEqual(req.requestBody, 'foo');
4141
return [
4242
200,
4343
{ 'Content-Type': 'text/json' },
@@ -50,11 +50,11 @@ module('Acceptance: Root', function (hooks) {
5050
body: 'foo',
5151
})
5252
.then(function (res) {
53-
assert.equal(res.status, 200);
53+
assert.strictEqual(res.status, 200);
5454
return res.json();
5555
})
5656
.then(function (data) {
57-
assert.equal(data.name, 'World');
57+
assert.strictEqual(data.name, 'World');
5858
});
5959
});
6060

@@ -75,11 +75,11 @@ module('Acceptance: Root', function (hooks) {
7575
body: form,
7676
})
7777
.then(function (res) {
78-
assert.equal(res.status, 200);
78+
assert.strictEqual(res.status, 200);
7979
return res.json();
8080
})
8181
.then(function (data) {
82-
assert.equal(data.name, 'World');
82+
assert.strictEqual(data.name, 'World');
8383
});
8484
});
8585

@@ -98,11 +98,11 @@ module('Acceptance: Root', function (hooks) {
9898
body: new window.ArrayBuffer(),
9999
})
100100
.then(function (res) {
101-
assert.equal(res.status, 200);
101+
assert.strictEqual(res.status, 200);
102102
return res.json();
103103
})
104104
.then(function (data) {
105-
assert.equal(data.name, 'World');
105+
assert.strictEqual(data.name, 'World');
106106
});
107107
});
108108

tests/unit/utils/mung-options-for-fetch-test.js

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ module('Unit | mungOptionsForFetch', function () {
7070
};
7171

7272
const options = mungOptionsForFetch(getOptions);
73-
assert.equal(options.method, 'GET');
73+
assert.strictEqual(options.method, 'GET');
7474
});
7575

7676
test('mungOptionsForFetch sets the method to an uppercase string', function (assert) {
@@ -81,15 +81,15 @@ module('Unit | mungOptionsForFetch', function () {
8181
};
8282

8383
let options = mungOptionsForFetch(getOptions);
84-
assert.equal(options.method, 'GET');
84+
assert.strictEqual(options.method, 'GET');
8585

8686
const postOptions = {
8787
url: 'https://emberjs.com',
8888
method: 'post',
8989
};
9090

9191
options = mungOptionsForFetch(postOptions);
92-
assert.equal(options.method, 'POST');
92+
assert.strictEqual(options.method, 'POST');
9393
});
9494

9595
test('mungOptionsForFetch adds string query params to the url correctly', function (assert) {
@@ -102,7 +102,7 @@ module('Unit | mungOptionsForFetch', function () {
102102
};
103103

104104
let options = mungOptionsForFetch(noQueryStringOptions);
105-
assert.equal(
105+
assert.strictEqual(
106106
options.url,
107107
`${baseUrl}?a=1&b=2`,
108108
'url that started without query params has query params'
@@ -114,7 +114,7 @@ module('Unit | mungOptionsForFetch', function () {
114114
};
115115

116116
options = mungOptionsForFetch(hasQueryStringOptions);
117-
assert.equal(
117+
assert.strictEqual(
118118
options.url,
119119
`${baseUrl}?fastboot=true&a=1&b=2`,
120120
'url that started with query params has more query params'
@@ -154,7 +154,7 @@ module('Unit | mungOptionsForFetch', function () {
154154

155155
// Tests POST method.
156156
let options = mungOptionsForFetch(baseOptions);
157-
assert.equal(
157+
assert.strictEqual(
158158
options.body,
159159
JSON.stringify(baseOptions.data),
160160
'POST request body correctly set'
@@ -163,7 +163,7 @@ module('Unit | mungOptionsForFetch', function () {
163163
// Tests PUT method.
164164
baseOptions.type = 'PUT';
165165
options = mungOptionsForFetch(baseOptions);
166-
assert.equal(
166+
assert.strictEqual(
167167
options.body,
168168
JSON.stringify(baseOptions.data),
169169
'PUT request body correctly set'
@@ -172,7 +172,7 @@ module('Unit | mungOptionsForFetch', function () {
172172
// Tests DELETE method.
173173
baseOptions.type = 'DELETE';
174174
options = mungOptionsForFetch(baseOptions);
175-
assert.equal(
175+
assert.strictEqual(
176176
options.body,
177177
JSON.stringify(baseOptions.data),
178178
'DELETE request has the correct body'
@@ -204,31 +204,31 @@ module('Unit | mungOptionsForFetch', function () {
204204
};
205205

206206
let options = mungOptionsForFetch(baseOptions);
207-
assert.equal(
207+
assert.strictEqual(
208208
options.body,
209209
undefined,
210210
'GET request does not have a request body'
211211
);
212212

213213
baseOptions.type = 'HEAD';
214214
options = mungOptionsForFetch(baseOptions);
215-
assert.equal(
215+
assert.strictEqual(
216216
options.body,
217217
undefined,
218218
'HEAD request does not have a request body'
219219
);
220220

221221
baseOptions.data = {};
222222
options = mungOptionsForFetch(baseOptions);
223-
assert.equal(
223+
assert.strictEqual(
224224
options.body,
225225
undefined,
226226
'HEAD request does not have a request body when `data` is an empty object'
227227
);
228228

229229
baseOptions.type = 'GET';
230230
options = mungOptionsForFetch(baseOptions);
231-
assert.equal(
231+
assert.strictEqual(
232232
options.body,
233233
undefined,
234234
'GET request does not have a request body when `data` is an empty object'
@@ -245,7 +245,7 @@ module('Unit | mungOptionsForFetch', function () {
245245
};
246246

247247
const getOptions = mungOptionsForFetch(getData);
248-
assert.equal(
248+
assert.strictEqual(
249249
getOptions.url.indexOf('?'),
250250
-1,
251251
'A question mark is not added if there are no query params to add'
@@ -258,7 +258,11 @@ module('Unit | mungOptionsForFetch', function () {
258258
};
259259

260260
const postOptions = mungOptionsForFetch(postData);
261-
assert.equal(postOptions.body, '{}', "'options.body' is an empty object");
261+
assert.strictEqual(
262+
postOptions.body,
263+
'{}',
264+
"'options.body' is an empty object"
265+
);
262266
});
263267

264268
test("mungOptionsForFetch sets the request body correctly when 'data' is FormData", function (assert) {
@@ -272,7 +276,7 @@ module('Unit | mungOptionsForFetch', function () {
272276
};
273277

274278
const postOptions = mungOptionsForFetch(postData);
275-
assert.equal(
279+
assert.strictEqual(
276280
postOptions.body,
277281
formData,
278282
"'options.body' is the FormData passed in"
@@ -291,7 +295,7 @@ module('Unit | mungOptionsForFetch', function () {
291295
};
292296

293297
const postOptions = mungOptionsForFetch(postData);
294-
assert.equal(
298+
assert.strictEqual(
295299
postOptions.body,
296300
JSON.stringify(data),
297301
"'options.body' is properly converted to a string"

tests/unit/utils/serialize-query-params-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module('Unit | serializeQueryParams', function () {
1818
};
1919
const queryParamString = serializeQueryParams(body);
2020

21-
assert.equal(
21+
assert.strictEqual(
2222
queryParamString,
2323
'a=1&b=2&c%5Bd%5D=3&c%5Be%5D%5Bf%5D=4&c%5Bg%5D%5B%5D=5&c%5Bg%5D%5B%5D=6&c%5Bg%5D%5B%5D=7'
2424
);
@@ -43,7 +43,7 @@ module('Unit | serializeQueryParams', function () {
4343
};
4444
const queryParamString = serializeQueryParams(body);
4545

46-
assert.equal(
46+
assert.strictEqual(
4747
queryParamString,
4848
'b=2&c%5Be%5D%5Bf%5D=4&c%5Bg%5D%5B%5D=5&c%5Bg%5D%5B%5D=6&c%5Bg%5D%5B%5D=7&h=&i=0&j=false'
4949
);

0 commit comments

Comments
 (0)