From 88dca55af8cdf0637ec3f321556e6252c17b05c7 Mon Sep 17 00:00:00 2001 From: Bert De Block Date: Mon, 21 Feb 2022 10:47:17 +0100 Subject: [PATCH] [RFC 637] Customizable test setups --- blueprints/app/files/tests/helpers/.gitkeep | 0 blueprints/app/files/tests/helpers/index.js | 30 +++++++++++++++++++++ 2 files changed, 30 insertions(+) delete mode 100644 blueprints/app/files/tests/helpers/.gitkeep create mode 100644 blueprints/app/files/tests/helpers/index.js diff --git a/blueprints/app/files/tests/helpers/.gitkeep b/blueprints/app/files/tests/helpers/.gitkeep deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/blueprints/app/files/tests/helpers/index.js b/blueprints/app/files/tests/helpers/index.js new file mode 100644 index 00000000000..5b7156c6cc9 --- /dev/null +++ b/blueprints/app/files/tests/helpers/index.js @@ -0,0 +1,30 @@ +import { + setupApplicationTest as upstreamSetupApplicationTest, + setupRenderingTest, + setupTest, +} from 'ember-qunit'; + +// This file exists to provide wrappers around ember-qunit's / ember-mocha's +// test setup functions. This way, you can easily extend the setup that is +// needed per test type. + +function setupApplicationTest(hooks, options) { + upstreamSetupApplicationTest(hooks, options); + + // Additional setup for application tests can be done here. + // + // For example, if you need an authenticated session for each + // application test, you could add: + // + // hooks.beforeEach(async function () { + // await authenticateSession(); // ember-simple-auth + // }); + // + // This is also a good place to call test setup functions coming + // from other addons: + // + // setupIntl(hooks); // ember-intl + // setupMirage(hooks); // ember-cli-mirage +} + +export { setupApplicationTest, setupRenderingTest, setupTest };