Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Handle DOMException error in Ava tests #3370

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ava
Submodule ava added at 2bc376
8 changes: 8 additions & 0 deletions test-tap/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import Test from '../lib/test.js';
import {set as setOptions} from '../lib/worker/options.cjs';

import {ava} from './helper/ava-test.js';
import test from 'ava';


setOptions({});

Expand Down Expand Up @@ -766,3 +768,9 @@ test('t.passed value is false when teardown callback is executed for failing tes
title: 'foo',
}).run();
});
test('DOMException should be considered an error', async t => {
await t.throwsAsync(
Promise.reject(new DOMException('an error')),
{ instanceOf: DOMException } // Explicitly specify the expected error type
);
});
Loading