Skip to content

Commit

Permalink
add timeoutMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
snewcomer committed Apr 5, 2018
1 parent de208ec commit 9d695e5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/unit/dom/wait-for-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,22 @@ module('DOM Helper: waitFor', function(hooks) {

let start = Date.now();
try {
await waitFor('.something', { timeout: 100, timeoutMessage: '.something timed out' });
await waitFor('.something', { timeout: 100 });
} catch (error) {
let end = Date.now();
assert.ok(end - start >= 100, 'timed out after correct time');
assert.equal(error.message, 'waitFor timed out');
}
});

test('wait for selector with timeoutMessage', async function(assert) {
assert.expect(1);

await setupContext(context);

try {
await waitFor('.something', { timeoutMessage: '.something timed out' });
} catch (error) {
assert.equal(error.message, '.something timed out');
}
});
Expand Down

0 comments on commit 9d695e5

Please sign in to comment.