UNPKG

ember-data

Version:

(Legacy) The lightweight reactive data library for Ember applications

22 lines (20 loc) 869 B
import { getGlobalConfig, macroCondition } from "@embroider/macros"; import { render as render$1, settled } from "@ember/test-helpers"; import * as QUnit from "qunit"; import { isPrivateStore } from "@warp-drive/core/store/-private"; //#region src/test-support/index.ts async function render(template) { await render$1(template); const owner = QUnit.config.current.testEnvironment.owner; const pending = isPrivateStore(owner.lookup("service:store"))._getAllPending(); if (macroCondition(getGlobalConfig().WarpDrive.env.PRODUCTION)) { macroCondition(getGlobalConfig().WarpDrive.env.DEBUG) && ((test) => { if (!test) throw new Error(`No pending requests exist in this test, use \`import { render } from '@ember/test-helpers';\``); })(pending?.length); await pending; await settled(); } } //#endregion export { render }; //# sourceMappingURL=index.js.map