Skip to content
This repository was archived by the owner on Dec 31, 2022. It is now read-only.

Commit a697276

Browse files
committed
chore: cleanup all legacy test blueprints support
BREAKING CHANGE: drops all support for pre-[RFC 0232][rfc] blueprints, since these have long since been replaced. Note that this commit also removes the component blueprints entirely, in favor of landing updated versions of them in [another PR][pr]. [rfc]: https://emberjs.github.io/rfcs/0232-simplify-qunit-testing-api.html [pr]: #213
1 parent 342f2ca commit a697276

File tree

141 files changed

+550
-3740
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+550
-3740
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
1-
import { describe, it, beforeEach, afterEach } from 'mocha';
1+
import { describe, it } from 'mocha';
22
import { expect } from 'chai';
3-
import startApp from '<%= dasherizedPackageName %>/tests/helpers/start-app';
4-
<% if (destroyAppExists) { %>import destroyApp from '<%= dasherizedPackageName %>/tests/helpers/destroy-app';<% } else { %>import { run } from '@ember/runloop';<% } %>
3+
import { setupApplicationTest } from 'ember-mocha';
4+
import { visit, currentURL } from '@ember/test-helpers';
55

66
describe('<%= friendlyTestName %>', function() {
7-
let application;
7+
setupApplicationTest();
88

9-
beforeEach(function() {
10-
application = startApp();
11-
});
12-
13-
afterEach(function() {
14-
<% if (destroyAppExists) { %>destroyApp(application);<% } else { %>run(application, 'destroy');<% } %>
15-
});
16-
17-
it('can visit /<%= dasherizedModuleName %>', function() {
18-
visit('/<%= dasherizedModuleName %>');
19-
20-
return andThen(() => {
21-
expect(currentURL()).to.equal('/<%= dasherizedModuleName %>');
22-
});
9+
it('can visit /<%= dasherizedModuleName %>', async function() {
10+
await visit('/<%= dasherizedModuleName %>');
11+
expect(currentURL()).to.equal('/<%= dasherizedModuleName %>');
2312
});
2413
});

blueprints/acceptance-test/mocha-rfc-232-files/tests/acceptance/__name__-test.ts

-13
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import { test } from 'qunit';
2-
import moduleForAcceptance from '<%= testFolderRoot %>/tests/helpers/module-for-acceptance';
1+
import { module, test } from 'qunit';
2+
import { visit, currentURL } from '@ember/test-helpers';
3+
import { setupApplicationTest } from 'ember-qunit';
34

4-
moduleForAcceptance('<%= friendlyTestName %>');
5+
module('<%= friendlyTestName %>', function(hooks) {
6+
setupApplicationTest(hooks);
57

6-
test('visiting /<%= dasherizedModuleName %>', function(assert) {
7-
visit('/<%= dasherizedModuleName %>');
8+
test('visiting /<%= dasherizedModuleName %>', async function(assert) {
9+
await visit('/<%= dasherizedModuleName %>');
810

9-
andThen(function() {
1011
assert.equal(currentURL(), '/<%= dasherizedModuleName %>');
1112
});
1213
});

blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.ts

-13
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { moduleFor, test } from 'ember-qunit';
1+
import { module, test } from 'qunit';
2+
import { setupTest } from 'ember-qunit';
23

3-
moduleFor('adapter:<%= dasherizedModuleName %>', '<%= friendlyTestDescription %>', {
4-
// Specify the other units that are required for this test.
5-
// needs: ['serializer:foo']
6-
});
4+
module('<%= friendlyTestDescription %>', function(hooks) {
5+
setupTest(hooks);
76

8-
// Replace this with your real tests.
9-
test('it exists', function(assert) {
10-
let adapter = this.subject();
11-
assert.ok(adapter);
7+
// Replace this with your real tests.
8+
test('it exists', function(assert) {
9+
let adapter = this.owner.lookup('adapter:<%= dasherizedModuleName %>');
10+
assert.ok(adapter);
11+
});
1212
});

blueprints/adapter-test/qunit-rfc-232-files/tests/unit/__path__/__test__.ts

-12
This file was deleted.

blueprints/component-test/index.js

-65
This file was deleted.

blueprints/component-test/mocha-0.12-files/__root__/__testType__/__path__/__test__.ts

-31
This file was deleted.

blueprints/component-test/mocha-files/__root__/__testType__/__path__/__test__.ts

-31
This file was deleted.

blueprints/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.ts

-38
This file was deleted.

blueprints/component-test/qunit-files/__root__/__testType__/__path__/__test__.ts

-31
This file was deleted.

blueprints/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.ts

-36
This file was deleted.

blueprints/component/files/__root__/__path__/__name__.ts

-7
This file was deleted.

blueprints/component/files/__root__/__templatepath__/__templatename__.hbs

-1
This file was deleted.

blueprints/component/glimmer-files/__root__/__path__/__name__.ts

-5
This file was deleted.

blueprints/component/glimmer-files/__root__/__templatepath__/__templatename__.hbs

-1
This file was deleted.

0 commit comments

Comments
 (0)