From 6096358ddd05a85909f510942e9d606dfad977c2 Mon Sep 17 00:00:00 2001 From: Bert De Block Date: Wed, 6 Mar 2024 11:10:45 +0100 Subject: [PATCH] Avoid importing from `ember-qunit` --- ember-graphql-mocking/package.json | 2 -- ember-graphql-mocking/src/test-support/index.ts | 10 ++++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ember-graphql-mocking/package.json b/ember-graphql-mocking/package.json index ab95cfc..9a86594 100644 --- a/ember-graphql-mocking/package.json +++ b/ember-graphql-mocking/package.json @@ -80,7 +80,6 @@ "@typescript-eslint/parser": "^6.14.0", "babel-plugin-ember-template-compilation": "^2.2.1", "concurrently": "^8.2.2", - "ember-qunit": "^8.0.2", "ember-source": "~5.6.0", "ember-template-lint": "^5.13.0", "eslint": "^8.56.0", @@ -98,7 +97,6 @@ "typescript": "^5.3.3" }, "peerDependencies": { - "ember-qunit": ">= 8.0.0", "ember-source": ">= 4.8.0", "graphql": ">= 16.0.0", "msw": ">= 2.0.0" diff --git a/ember-graphql-mocking/src/test-support/index.ts b/ember-graphql-mocking/src/test-support/index.ts index 3148f2f..1aa3bac 100644 --- a/ember-graphql-mocking/src/test-support/index.ts +++ b/ember-graphql-mocking/src/test-support/index.ts @@ -1,5 +1,4 @@ import { assert } from '@ember/debug'; -import { type setupApplicationTest } from 'ember-qunit'; import { buildASTSchema, graphql, type DocumentNode } from 'graphql'; import merge from 'lodash.merge'; import { graphql as mswGraphql, HttpResponse } from 'msw'; @@ -10,6 +9,11 @@ interface Options { } type WindowWithTestem = typeof window & { Testem: unknown }; +type Hooks = { + after(fn: () => void | Promise): void; + afterEach(fn: () => void | Promise): void; + before(fn: () => void | Promise): void; +}; const IS_TESTEM = Boolean((window as WindowWithTestem).Testem); const DEFAULT_OPTIONS: Options = { @@ -39,9 +43,7 @@ export async function setupEmberGraphqlMocking( await startWorker(options.mswStartOptions); } -export function setupGraphqlTest( - hooks: Parameters[0], -) { +export function setupGraphqlTest(hooks: Hooks) { assert( 'Cannot call `setupGraphqlTest` without providing the `hooks` argument. Please make sure to call `setupGraphqlTest(hooks);`.', hooks,