Skip to content

Commit

Permalink
add mocha rfc 232 util test
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhaulagiri committed Aug 18, 2018
1 parent acd144f commit ff450ee
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import <%= camelizedModuleName %> from '<%= dasherizedPackageName %>/utils/<%= dasherizedModuleName %>';

describe('<%= friendlyTestName %>', function() {
// Replace this with your real tests.
it('works', function() {
let result = <%= camelizedModuleName %>();
expect(result).to.be.ok;
});
});
18 changes: 18 additions & 0 deletions node-tests/blueprints/util-test-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,24 @@ describe('Blueprint: util-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('util-test foo-bar', function() {
return emberGenerateDestroy(['util-test', 'foo-bar'], _file => {
expect(_file('tests/unit/utils/foo-bar-test.js')).to.equal(
fixture('util-test/mocha-rfc232.js')
);
});
});
});
});

describe('in app - module uninification', function() {
Expand Down
11 changes: 11 additions & 0 deletions node-tests/fixtures/util-test/mocha-rfc232.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import fooBar from 'my-app/utils/foo-bar';

describe('Unit | Utility | foo-bar', function() {
// Replace this with your real tests.
it('works', function() {
let result = fooBar();
expect(result).to.be.ok;
});
});

0 comments on commit ff450ee

Please sign in to comment.