Skip to content

Commit

Permalink
Merge pull request #16899 from Dhaulagiri/br-268-acceptance
Browse files Browse the repository at this point in the history
add mocha rfc 268 acceptance tests
  • Loading branch information
rwjblue authored Sep 4, 2018
2 parents f1a7c81 + a47ff09 commit e565b03
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { describe, it } from 'mocha';
import { expect } from 'chai';
import { setupApplicationTest } from 'ember-mocha';
import { visit, currentURL } from '@ember/test-helpers';

describe('<%= friendlyTestName %>', function() {
setupApplicationTest();

it('can visit /<%= dasherizedModuleName %>', async function() {
await visit('/<%= dasherizedModuleName %>');
expect(currentURL()).to.equal('/<%= dasherizedModuleName %>');
});
});
18 changes: 18 additions & 0 deletions node-tests/blueprints/acceptance-test-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,24 @@ describe('Blueprint: acceptance-test', function() {
});
});
});

describe('with [email protected]', function() {
beforeEach(function() {
modifyPackages([
{ name: 'ember-cli-qunit', delete: true },
{ name: 'ember-mocha', dev: true },
]);
generateFakePackageManifest('ember-mocha', '0.14.0');
});

it('acceptance-test foo', function() {
return emberGenerateDestroy(['acceptance-test', 'foo'], _file => {
expect(_file('tests/acceptance/foo-test.js')).to.equal(
fixture('acceptance-test/mocha-rfc268.js')
);
});
});
});
});

describe('in addon', function() {
Expand Down
13 changes: 13 additions & 0 deletions node-tests/fixtures/acceptance-test/mocha-rfc268.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { describe, it } from 'mocha';
import { expect } from 'chai';
import { setupApplicationTest } from 'ember-mocha';
import { visit, currentURL } from '@ember/test-helpers';

describe('Acceptance | foo', function() {
setupApplicationTest();

it('can visit /foo', async function() {
await visit('/foo');
expect(currentURL()).to.equal('/foo');
});
});

0 comments on commit e565b03

Please sign in to comment.