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

[WIP] Update ember-cli #16459

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 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
5 changes: 0 additions & 5 deletions blueprints/acceptance-test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ module.exports = useTestFrameworkDetector({
testFolderRoot = pathUtil.getRelativeParentPath(options.entity.name, -1, false);
}

let destroyAppExists = fs.existsSync(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I think this still needs to exist no? This isn't about the ember-cli version that is being used by ember-source, but rather about the current project layout when the blueprint is ran...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, thanks for pointing this out. I enjoy deleting code so much, I just jumped right in 🙈

path.join(this.project.root, '/tests/helpers/destroy-app.js')
);

let friendlyTestName = [
'Acceptance',
stringUtils.dasherize(options.entity.name).replace(/[-]/g, ' '),
Expand All @@ -29,7 +25,6 @@ module.exports = useTestFrameworkDetector({
return {
testFolderRoot: testFolderRoot,
friendlyTestName,
destroyAppExists,
};
},
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, it, beforeEach, afterEach } from 'mocha';
import { expect } from 'chai';
import startApp from '<%= dasherizedPackageName %>/tests/helpers/start-app';
<% if (destroyAppExists) { %>import destroyApp from '<%= dasherizedPackageName %>/tests/helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
import { run } from '@ember/runloop';

describe('<%= friendlyTestName %>', function() {
let application;
Expand All @@ -11,7 +11,7 @@ describe('<%= friendlyTestName %>', function() {
});

afterEach(function() {
<% if (destroyAppExists) { %>destroyApp(application);<% } else { %>run(application, 'destroy');<% } %>
run(application, 'destroy');
});

it('can visit /<%= dasherizedModuleName %>', function() {
Expand Down
3 changes: 0 additions & 3 deletions blueprints/initializer-test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ module.exports = useTestFrameworkDetector({
return {
friendlyTestName: ['Unit', 'Initializer', options.entity.name].join(' | '),
dasherizedModulePrefix: stringUtils.dasherize(options.project.config().modulePrefix),
destroyAppExists: fs.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,6 @@ import { describe, it, beforeEach, afterEach } from 'mocha';
import { run } from '@ember/runloop';
import Application from '@ember/application';
import { initialize } from '<%= dasherizedModulePrefix %>/initializers/<%= dasherizedModuleName %>';
import destroyApp from '../../helpers/destroy-app';

describe('<%= friendlyTestName %>', function() {
let application;
Expand All @@ -16,7 +15,7 @@ describe('<%= friendlyTestName %>', function() {
});

afterEach(function() {
destroyApp(application);
run(application, 'destroy');
});

// Replace this with your real tests.
Expand Down
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';
<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop'; <% } %>
import { run } from '@ember/runloop';

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Application from '@ember/application';
import { initialize } from '<%= dasherizedModulePrefix %>/initializers/<%= dasherizedModuleName %>';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
import { run } from '@ember/runloop';

module('<%= friendlyTestName %>', function(hooks) {
setupTest(hooks);
Expand All @@ -19,7 +19,7 @@ module('<%= friendlyTestName %>', function(hooks) {
});

hooks.afterEach(function() {
<% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
run(this.application, 'destroy');
});

// Replace this with your real tests.
Expand Down
3 changes: 0 additions & 3 deletions blueprints/instance-initializer-test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ module.exports = useTestFrameworkDetector({
return {
friendlyTestName: ['Unit', 'Instance Initializer', options.entity.name].join(' | '),
dasherizedModulePrefix: stringUtils.dasherize(options.project.config().modulePrefix),
destroyAppExists: fs.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,6 @@ import { describe, it, beforeEach } from 'mocha';
import Application from '@ember/application';
import { run } from '@ember/runloop';
import { initialize } from '<%= dasherizedModulePrefix %>/instance-initializers/<%= dasherizedModuleName %>';
import destroyApp from '../../helpers/destroy-app';

describe('<%= friendlyTestName %>', function() {
let application, appInstance;
Expand All @@ -17,7 +16,7 @@ describe('<%= friendlyTestName %>', function() {

afterEach(function() {
run(appInstance, 'destroy');
destroyApp(application);
run(application, 'destroy');
});

// Replace this with your real tests.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import Application from '@ember/application';
import { run } from '@ember/runloop';
import { initialize } from '<%= dasherizedModulePrefix %>/instance-initializers/<%= dasherizedModuleName %>';
import { module, test } from 'qunit';<% if (destroyAppExists) { %>
import destroyApp from '../../helpers/destroy-app';<% } %>
import { module, test } from 'qunit';

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Application from '@ember/application';
import { initialize } from '<%= dasherizedModulePrefix %>/instance-initializers/<%= dasherizedModuleName %>';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
<% if (destroyAppExists) { %>import destroyApp from '../../helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
import { run } from '@ember/runloop';

module('<%= friendlyTestName %>', function(hooks) {
setupTest(hooks);
Expand All @@ -18,8 +18,8 @@ module('<%= friendlyTestName %>', function(hooks) {
this.instance = this.application.buildInstance();
});
hooks.afterEach(function() {
<% if (destroyAppExists) { %>destroyApp(this.application);<% } else { %>run(this.application, 'destroy');<% } %>
<% if (destroyAppExists) { %>destroyApp(this.instance);<% } else { %>run(this.instance, 'destroy');<% } %>
run(this.application, 'destroy');
run(this.instance, 'destroy');
});

// Replace this with your real tests.
Expand Down
4 changes: 2 additions & 2 deletions node-tests/fixtures/acceptance-test/mocha.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, it, beforeEach, afterEach } from 'mocha';
import { expect } from 'chai';
import startApp from 'my-app/tests/helpers/start-app';
import destroyApp from 'my-app/tests/helpers/destroy-app';
import { run } from '@ember/runloop';

describe('Acceptance | foo', function() {
let application;
Expand All @@ -11,7 +11,7 @@ describe('Acceptance | foo', function() {
});

afterEach(function() {
destroyApp(application);
run(application, 'destroy');
});

it('can visit /foo', function() {
Expand Down
3 changes: 1 addition & 2 deletions node-tests/fixtures/initializer-test/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { run } from '@ember/runloop';

import { initialize } from 'my-app/initializers/foo';
import { module, test } from 'qunit';
import destroyApp from '../../helpers/destroy-app';

module('Unit | Initializer | foo', {
beforeEach() {
Expand All @@ -13,7 +12,7 @@ module('Unit | Initializer | foo', {
});
},
afterEach() {
destroyApp(this.application);
run(application, 'destroy');
}
});

Expand Down
3 changes: 1 addition & 2 deletions node-tests/fixtures/initializer-test/dummy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { run } from '@ember/runloop';

import { initialize } from 'dummy/initializers/foo';
import { module, test } from 'qunit';
import destroyApp from '../../helpers/destroy-app';

module('Unit | Initializer | foo', {
beforeEach() {
Expand All @@ -13,7 +12,7 @@ module('Unit | Initializer | foo', {
});
},
afterEach() {
destroyApp(this.application);
run(this.application, 'destroy');
}
});

Expand Down
3 changes: 1 addition & 2 deletions node-tests/fixtures/initializer-test/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { describe, it, beforeEach, afterEach } from 'mocha';
import { run } from '@ember/runloop';
import Application from '@ember/application';
import { initialize } from 'my-app/initializers/foo';
import destroyApp from '../../helpers/destroy-app';

describe('Unit | Initializer | foo', function() {
let application;
Expand All @@ -16,7 +15,7 @@ describe('Unit | Initializer | foo', function() {
});

afterEach(function() {
destroyApp(application);
run(application, 'destroy');
});

// Replace this with your real tests.
Expand Down
3 changes: 1 addition & 2 deletions node-tests/fixtures/initializer-test/rfc232.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Application from '@ember/application';
import { initialize } from 'my-app/initializers/foo';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import destroyApp from '../../helpers/destroy-app';

module('Unit | Initializer | foo', function(hooks) {
setupTest(hooks);
Expand All @@ -19,7 +18,7 @@ module('Unit | Initializer | foo', function(hooks) {
});

hooks.afterEach(function() {
destroyApp(this.application);
run(this.application, 'destroy');
});

// Replace this with your real tests.
Expand Down
3 changes: 1 addition & 2 deletions node-tests/fixtures/instance-initializer-test/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import Application from '@ember/application';
import { run } from '@ember/runloop';
import { initialize } from 'my-app/instance-initializers/foo';
import { module, test } from 'qunit';
import destroyApp from '../../helpers/destroy-app';

module('Unit | Instance Initializer | foo', {
beforeEach() {
Expand All @@ -13,7 +12,7 @@ module('Unit | Instance Initializer | foo', {
},
afterEach() {
run(this.appInstance, 'destroy');
destroyApp(this.application);
run(this.application, 'destroy');
}
});

Expand Down
3 changes: 1 addition & 2 deletions node-tests/fixtures/instance-initializer-test/dummy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import Application from '@ember/application';
import { run } from '@ember/runloop';
import { initialize } from 'dummy/instance-initializers/foo';
import { module, test } from 'qunit';
import destroyApp from '../../helpers/destroy-app';

module('Unit | Instance Initializer | foo', {
beforeEach() {
Expand All @@ -13,7 +12,7 @@ module('Unit | Instance Initializer | foo', {
},
afterEach() {
run(this.appInstance, 'destroy');
destroyApp(this.application);
run(this.application, 'destroy');
}
});

Expand Down
3 changes: 1 addition & 2 deletions node-tests/fixtures/instance-initializer-test/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { describe, it, beforeEach } from 'mocha';
import Application from '@ember/application';
import { run } from '@ember/runloop';
import { initialize } from 'my-app/instance-initializers/foo';
import destroyApp from '../../helpers/destroy-app';

describe('Unit | Instance Initializer | foo', function() {
let application, appInstance;
Expand All @@ -17,7 +16,7 @@ describe('Unit | Instance Initializer | foo', function() {

afterEach(function() {
run(appInstance, 'destroy');
destroyApp(application);
run(application, 'destroy');
});

// Replace this with your real tests.
Expand Down
5 changes: 2 additions & 3 deletions node-tests/fixtures/instance-initializer-test/rfc232.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Application from '@ember/application';
import { initialize } from 'my-app/instance-initializers/foo';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import destroyApp from '../../helpers/destroy-app';

module('Unit | Instance Initializer | foo', function(hooks) {
setupTest(hooks);
Expand All @@ -18,8 +17,8 @@ module('Unit | Instance Initializer | foo', function(hooks) {
this.instance = this.application.buildInstance();
});
hooks.afterEach(function() {
destroyApp(this.application);
destroyApp(this.instance);
run(this.application, 'destroy');
run(this.instance, 'destroy');
});

// Replace this with your real tests.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"broccoli-uglify-sourcemap": "^2.0.2",
"common-tags": "^1.7.2",
"dag-map": "^2.0.2",
"ember-cli": "github:ember-cli/ember-cli#76175513c5e49caf5405b7304e83ddf3e799c68e",
"ember-cli": "github:ember-cli/ember-cli#ec12c757fab32d4207f35e4ddd048a4cfba2289a",
"ember-cli-blueprint-test-helpers": "^0.18.3",
"ember-cli-browserstack": "^0.0.6",
"ember-cli-dependency-checker": "^2.1.0",
Expand Down
Loading