From 11d5a3d8f44f1f9f991ce7751e14d82ff5690b38 Mon Sep 17 00:00:00 2001 From: Alex Reardon Date: Thu, 23 May 2024 09:43:11 +1000 Subject: [PATCH] updating jest setup --- jest.config.js | 3 ++- test/bind-event-listener/bind-all.spec.ts | 2 +- test/bind-event-listener/bind.spec.ts | 2 +- test/type-tests/public-types-object-listener-test.ts | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/jest.config.js b/jest.config.js index cadb5e7..f72a45c 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,5 @@ /** @type {import('jest').Config} */ -module.exports = { +const config = { preset: 'ts-jest', testEnvironment: 'jsdom', // setupFiles: ['./test/env-setup.ts'], @@ -8,3 +8,4 @@ module.exports = { // testPathIgnorePatterns: ['/node_modules/', '/cypress/'], modulePathIgnorePatterns: ['/dist/'], }; +export default config; diff --git a/test/bind-event-listener/bind-all.spec.ts b/test/bind-event-listener/bind-all.spec.ts index 87bd072..c1b2820 100644 --- a/test/bind-event-listener/bind-all.spec.ts +++ b/test/bind-event-listener/bind-all.spec.ts @@ -1,4 +1,4 @@ -import { bindAll, UnbindFn } from '../../src'; +import { bindAll, type UnbindFn } from '../../src'; it('should allow for multiple bindings of different types', () => { const button: HTMLElement = document.createElement('button'); diff --git a/test/bind-event-listener/bind.spec.ts b/test/bind-event-listener/bind.spec.ts index 2ce227b..969ad8b 100644 --- a/test/bind-event-listener/bind.spec.ts +++ b/test/bind-event-listener/bind.spec.ts @@ -1,4 +1,4 @@ -import { UnbindFn } from '../../src/types'; +import type { UnbindFn } from '../../src/types'; import { bind } from '../../src'; it('should bind a listener', () => { diff --git a/test/type-tests/public-types-object-listener-test.ts b/test/type-tests/public-types-object-listener-test.ts index 9878aad..0599d44 100644 --- a/test/type-tests/public-types-object-listener-test.ts +++ b/test/type-tests/public-types-object-listener-test.ts @@ -1,5 +1,5 @@ import { expectTypeOf } from 'expect-type'; -import { Binding, Listener } from '../../src'; +import type { Binding, Listener } from '../../src'; import { expectType, TypeOf } from 'ts-expect'; // extracting event type