diff --git a/files/tests/test-helper.ts b/files/tests/test-helper.ts index 5c486bdb..c4dd1fd8 100644 --- a/files/tests/test-helper.ts +++ b/files/tests/test-helper.ts @@ -1,10 +1,30 @@ import Application from '<%= modulePrefix %>/app'; import config from '<%= modulePrefix %>/config/environment'; import * as QUnit from 'qunit'; -import { setApplication } from '@ember/test-helpers'; +import { setApplication, getSettledState, currentURL, currentRouteName } from '@ember/test-helpers'; +import { getPendingWaiterState } from '@ember/test-waiters'; import { setup } from 'qunit-dom'; import { start as qunitStart, setupEmberOnerrorValidation } from 'ember-qunit'; +Object.assign(window, { + getSettledState, + getPendingWaiterState, + currentURL, + currentRouteName, + snapshotTimers: (label?: string) => { + const result = JSON.parse( + JSON.stringify({ + settled: getSettledState(), + waiters: getPendingWaiterState(), + }) + ); + + console.debug(label ?? 'snapshotTimers', result); + + return result; + }, +}); + export function start() { setApplication(Application.create(config.APP));