Skip to content

Commit 608022b

Browse files
author
DavertMik
committed
implemented els module
1 parent 699fb24 commit 608022b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/unit/els_test.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ describe('els', () => {
108108
await els.eachElement('.selector', async el => {
109109
throw new Error(`failed on ${el}`);
110110
});
111+
await recorder.promise();
111112
throw new Error('should have thrown error');
112113
} catch (e) {
113114
expect(e.message).to.equal('failed on el1');
@@ -127,9 +128,10 @@ describe('els', () => {
127128

128129
try {
129130
await els.expectElement('.selector', async () => false);
131+
await recorder.promise();
130132
throw new Error('should have thrown error');
131133
} catch (e) {
132-
expect(e.message).to.include('element (.selector)');
134+
expect(e.cliMessage()).to.include('element (.selector)');
133135
}
134136
});
135137
});
@@ -146,9 +148,10 @@ describe('els', () => {
146148

147149
try {
148150
await els.expectAnyElement('.selector', async () => false);
151+
await recorder.promise();
149152
throw new Error('should have thrown error');
150153
} catch (e) {
151-
expect(e.message).to.include('any element of (.selector)');
154+
expect(e.cliMessage()).to.include('any element of (.selector)');
152155
}
153156
});
154157
});
@@ -165,9 +168,10 @@ describe('els', () => {
165168

166169
try {
167170
await els.expectAllElements('.selector', async el => el !== 'el2');
171+
await recorder.promise();
168172
throw new Error('should have thrown error');
169173
} catch (e) {
170-
expect(e.message).to.include('element #2 of (.selector)');
174+
expect(e.cliMessage()).to.include('element #2 of (.selector)');
171175
}
172176
});
173177
});

0 commit comments

Comments
 (0)