From 216fcf1c6bcde5d069a212b0a29c8612383d7fcc Mon Sep 17 00:00:00 2001 From: Atrue Date: Tue, 7 Feb 2023 16:27:56 +0400 Subject: [PATCH] do not test built-in error messages in tests --- tests/unit/factory.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/factory.test.js b/tests/unit/factory.test.js index 9349b81d..ffa9cef0 100644 --- a/tests/unit/factory.test.js +++ b/tests/unit/factory.test.js @@ -4,8 +4,8 @@ import { createEvent, createMessageEvent, createCloseEvent } from '../../src/eve const fakeObject = { foo: 'bar' }; test('that the create methods throw errors if no type if specified', t => { - t.throws(() => createEvent(), "Cannot read property 'type' of undefined"); - t.throws(() => createMessageEvent(), "Cannot read property 'type' of undefined"); + t.throws(() => createEvent(), error => error.name === 'TypeError'); + t.throws(() => createMessageEvent(), error => error.name === 'TypeError'); }); test('that createEvent correctly creates an event', t => {