Skip to content

Commit a460d77

Browse files
author
Andrey Fel
committed
Fix violations of qunit/require-expect rule
1 parent 4c152d8 commit a460d77

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/unit/qunit/async-iterator-test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ if (macroCondition(dependencySatisfies('ember-qunit', '*'))) {
4747
});
4848

4949
test('should get the value from response.', function (assert) {
50-
assert.expect(1);
5150
const done = assert.async();
5251
this.testem.on('next-module-request', () => {
5352
this.testem.emit('next-module-response', {
@@ -68,7 +67,6 @@ if (macroCondition(dependencySatisfies('ember-qunit', '*'))) {
6867
});
6968

7069
test('should iterate promises until there is no response.', function (assert) {
71-
assert.expect(1);
7270
const done = assert.async();
7371
const testem = this.testem;
7472
const responses = ['a', 'b', 'c'];
@@ -116,7 +114,6 @@ if (macroCondition(dependencySatisfies('ember-qunit', '*'))) {
116114
});
117115

118116
test('should dispose after iteration.', function (assert) {
119-
assert.expect(4);
120117
const done = assert.async();
121118
const testem = this.testem;
122119
const responses = ['a', 'b', 'c'];
@@ -154,7 +151,7 @@ if (macroCondition(dependencySatisfies('ember-qunit', '*'))) {
154151
});
155152

156153
test('should resolve with iterator finishing if request is not handled within 2s', function (assert) {
157-
assert.expect(1);
154+
const done = assert.async();
158155
const iteratorOfPromises = new AsyncIterator(this.testem, {
159156
request: 'next-module-request',
160157
response: 'next-module-response',
@@ -163,11 +160,12 @@ if (macroCondition(dependencySatisfies('ember-qunit', '*'))) {
163160

164161
return iteratorOfPromises.next().then((res) => {
165162
assert.true(res.done);
163+
done();
166164
});
167165
});
168166

169167
test('should resolve a timeout error if request is not handled within 2s when emberExamExitOnError is true', function (assert) {
170-
assert.expect(1);
168+
const done = assert.async();
171169
const iteratorOfPromises = new AsyncIterator(this.testem, {
172170
request: 'next-module-request',
173171
response: 'next-module-response',
@@ -178,12 +176,14 @@ if (macroCondition(dependencySatisfies('ember-qunit', '*'))) {
178176
return iteratorOfPromises.next().then(
179177
() => {
180178
assert.ok(false, 'Promise should not resolve, expecting reject');
179+
done();
181180
},
182181
(err) => {
183182
assert.deepEqual(
184183
err.message,
185184
'EmberExam: Promise timed out after 2 s while waiting for response for next-module-request',
186185
);
186+
done();
187187
},
188188
);
189189
});

0 commit comments

Comments
 (0)