Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion files/tests/test-helper.ts
Original file line number Diff line number Diff line change
@@ -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));

Expand Down
Loading