diff --git a/tests/default.test.mjs b/tests/default.test.mjs index 0036162..7314c40 100644 --- a/tests/default.test.mjs +++ b/tests/default.test.mjs @@ -49,7 +49,7 @@ describe('basic functionality', function () { let result; try { - result = await execa('pnpm', ['test'], { + result = await execa('pnpm', ['test:ember'], { cwd: join(tmpDir.path, appName), }); } catch (err) { diff --git a/tests/fixture/app/initializers/test-init.js b/tests/fixture/app/initializers/test-init.js new file mode 100644 index 0000000..f7bb350 --- /dev/null +++ b/tests/fixture/app/initializers/test-init.js @@ -0,0 +1,6 @@ +export default { + name: 'test-init', + initialize(application) { + application.__test_init = 'coming from the initializer'; + }, +}; diff --git a/tests/fixture/app/instance-initializers/test-instance-init.js b/tests/fixture/app/instance-initializers/test-instance-init.js new file mode 100644 index 0000000..856fe8c --- /dev/null +++ b/tests/fixture/app/instance-initializers/test-instance-init.js @@ -0,0 +1,6 @@ +export default { + name: 'test-instance-initializers', + initialize(instance) { + instance.__instance_test_init = 'set in the instance initializer'; + }, +}; diff --git a/tests/fixture/tests/acceptance/app-init-test.js b/tests/fixture/tests/acceptance/app-init-test.js new file mode 100644 index 0000000..72a3209 --- /dev/null +++ b/tests/fixture/tests/acceptance/app-init-test.js @@ -0,0 +1,13 @@ +import { module, test } from 'qunit'; +import { getApplication } from '@ember/test-helpers'; +import { setupApplicationTest } from '<%= name %>/tests/helpers'; + +module('Acceptance | app route', function (hooks) { + setupApplicationTest(hooks); + + test('loaded initializers /', async function (assert) { + const app = getApplication(); + assert.strictEqual([...app._applicationInstances][0].__instance_test_init, 'set in the instance initializer'); + assert.strictEqual(app.__test_init, 'coming from the initializer'); + }); +});