Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Don't use destroyApp if new API is being used #16229

Merged
merged 1 commit into from
Feb 21, 2018
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion blueprints/acceptance-test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = useTestFrameworkDetector({
return {
testFolderRoot: testFolderRoot,
friendlyTestName,
destroyAppExists: destroyAppExists
destroyAppExists
};
}
});
5 changes: 4 additions & 1 deletion blueprints/initializer-test/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use strict';

const path = require('path');
const stringUtils = require('ember-cli-string-utils');
const existsSync = require('exists-sync');

const useTestFrameworkDetector = require('../test-framework-detector');

Expand All @@ -9,7 +11,8 @@ module.exports = useTestFrameworkDetector({
locals: function(options) {
return {
friendlyTestName: ['Unit', 'Initializer', options.entity.name].join(' | '),
dasherizedModulePrefix: stringUtils.dasherize(options.project.config().modulePrefix)
dasherizedModulePrefix: stringUtils.dasherize(options.project.config().modulePrefix),
destroyAppExists: existsSync(path.join(this.project.root, '/tests/helpers/destroy-app.js'))
};
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { run } from '@ember/runloop';

import { initialize } from '<%= dasherizedModulePrefix %>/initializers/<%= dasherizedModuleName %>';
import { module, test } from 'qunit';
import destroyApp from '../../helpers/destroy-app';
<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop'; <% } %>

module('<%= friendlyTestName %>', {
beforeEach() {
Expand All @@ -13,7 +13,7 @@ module('<%= friendlyTestName %>', {
});
},
afterEach() {
destroyApp(this.application);
<% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
}
});

Expand Down