Skip to content

Commit

Permalink
Avoid importing from ember-qunit
Browse files Browse the repository at this point in the history
  • Loading branch information
bertdeblock committed Mar 6, 2024
1 parent 18446d0 commit 6096358
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 0 additions & 2 deletions ember-graphql-mocking/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
Expand Down
10 changes: 6 additions & 4 deletions ember-graphql-mocking/src/test-support/index.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -10,6 +9,11 @@ interface Options {
}

type WindowWithTestem = typeof window & { Testem: unknown };
type Hooks = {
after(fn: () => void | Promise<void>): void;
afterEach(fn: () => void | Promise<void>): void;
before(fn: () => void | Promise<void>): void;
};

const IS_TESTEM = Boolean((window as WindowWithTestem).Testem);
const DEFAULT_OPTIONS: Options = {
Expand Down Expand Up @@ -39,9 +43,7 @@ export async function setupEmberGraphqlMocking(
await startWorker(options.mswStartOptions);
}

export function setupGraphqlTest(
hooks: Parameters<typeof setupApplicationTest>[0],
) {
export function setupGraphqlTest(hooks: Hooks) {
assert(
'Cannot call `setupGraphqlTest` without providing the `hooks` argument. Please make sure to call `setupGraphqlTest(hooks);`.',
hooks,
Expand Down

0 comments on commit 6096358

Please sign in to comment.