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

add remaining mocha rfc 232 blueprints #5665

Merged
merged 4 commits into from
Oct 4, 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupTest } from 'ember-mocha';

describe('<%= friendlyTestDescription %>', function() {
setupTest();

// Replace this with your real tests.
it('exists', function() {
let store = this.owner.lookup('service:store');
let model = store.createRecord('<%= dasherizedModuleName %>', {});
expect(model).to.be.ok;
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupTest } from 'ember-mocha';

describe('<%= friendlyTestDescription %>', function() {
setupTest();

// Replace this with your real tests.
it('exists', function() {
let store = this.owner.lookup('service:store');
let serializer = store.serializerFor('<%= dasherizedModuleName %>');

expect(serializer).to.be.ok;
});

it('serializes records', function() {
let store = this.owner.lookup('service:store');
let record = store.createRecord('<%= dasherizedModuleName %>', {});

let serializedRecord = record.serialize();

expect(serializedRecord).to.be.ok;
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupTest } from 'ember-mocha';

describe('<%= friendlyTestDescription %>', function() {
setupTest();

// Replace this with your real tests.
it('exists', function() {
let transform = this.owner.lookup('transform:<%= dasherizedModuleName %>');
expect(transform).to.be.ok;
});
});
24 changes: 24 additions & 0 deletions node-tests/blueprints/adapter-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,5 +287,29 @@ describe('Acceptance: generate and destroy adapter blueprints', function() {
);
});
});

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

it('adapter-test for mocha v0.14+', function() {
let args = ['adapter-test', 'foo'];

return emberGenerateDestroy(
args,
_file => {
expect(_file('src/data/models/foo/adapter-test.js')).to.equal(
fixture('adapter-test/mocha-rfc232.js')
);
},
{ isModuleUnification: true }
);
});
});
});
});
44 changes: 44 additions & 0 deletions node-tests/blueprints/model-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,26 @@ describe('Acceptance: generate and destroy model blueprints', function() {
});
});
});

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

it('model-test for mocha v0.14+', function() {
let args = ['model-test', 'foo'];

return emberGenerateDestroy(args, _file => {
expect(_file('tests/unit/models/foo-test.js')).to.equal(
fixture('model-test/mocha-rfc232.js')
);
});
});
});
});

describe('module unification', function() {
Expand Down Expand Up @@ -297,5 +317,29 @@ describe('Acceptance: generate and destroy model blueprints', function() {
);
});
});

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

it('model-test for mocha v0.14+', function() {
let args = ['model-test', 'foo'];

return emberGenerateDestroy(
args,
_file => {
expect(_file('src/data/models/foo/model-test.js')).to.equal(
fixture('model-test/mocha-rfc232.js')
);
},
{ isModuleUnification: true }
);
});
});
});
});
44 changes: 44 additions & 0 deletions node-tests/blueprints/serializer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,26 @@ describe('Acceptance: generate and destroy serializer blueprints', function() {
});
});
});

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

it('serializer-test for mocha v0.14+', function() {
let args = ['serializer-test', 'foo'];

return emberGenerateDestroy(args, _file => {
expect(_file('tests/unit/serializers/foo-test.js')).to.equal(
fixture('serializer-test/mocha-rfc232.js')
);
});
});
});
});

describe('module unification', function() {
Expand Down Expand Up @@ -278,5 +298,29 @@ describe('Acceptance: generate and destroy serializer blueprints', function() {
);
});
});

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

it('serializer-test for mocha v0.14+', function() {
let args = ['serializer-test', 'foo'];

return emberGenerateDestroy(
args,
_file => {
expect(_file('src/data/models/foo/serializer-test.js')).to.equal(
fixture('serializer-test/mocha-rfc232.js')
);
},
{ isModuleUnification: true }
);
});
});
});
});
44 changes: 44 additions & 0 deletions node-tests/blueprints/transform-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,26 @@ describe('Acceptance: generate and destroy transform blueprints', function() {
});
});
});

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

it('transform-test for mocha v0.14+', function() {
let args = ['transform-test', 'foo'];

return emberGenerateDestroy(args, _file => {
expect(_file('tests/unit/transforms/foo-test.js')).to.equal(
fixture('transform-test/mocha-rfc232.js')
);
});
});
});
});
});

Expand Down Expand Up @@ -164,6 +184,30 @@ describe('Acceptance: generate and destroy transform blueprints', function() {
);
});
});

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

it('transform-test for mocha v0.14+', function() {
let args = ['transform-test', 'foo'];

return emberGenerateDestroy(
args,
_file => {
expect(_file('src/data/transforms/foo-test.js')).to.equal(
fixture('transform-test/mocha-rfc232.js')
);
},
{ isModuleUnification: true }
);
});
});
});
});
});
14 changes: 14 additions & 0 deletions node-tests/fixtures/model-test/mocha-rfc232.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupTest } from 'ember-mocha';

describe('Unit | Model | foo', function() {
setupTest();

// Replace this with your real tests.
it('exists', function() {
let store = this.owner.lookup('service:store');
let model = store.createRecord('foo', {});
expect(model).to.be.ok;
});
});
24 changes: 24 additions & 0 deletions node-tests/fixtures/serializer-test/mocha-rfc232.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupTest } from 'ember-mocha';

describe('Unit | Serializer | foo', function() {
setupTest();

// Replace this with your real tests.
it('exists', function() {
let store = this.owner.lookup('service:store');
let serializer = store.serializerFor('foo');

expect(serializer).to.be.ok;
});

it('serializes records', function() {
let store = this.owner.lookup('service:store');
let record = store.createRecord('foo', {});

let serializedRecord = record.serialize();

expect(serializedRecord).to.be.ok;
});
});
13 changes: 13 additions & 0 deletions node-tests/fixtures/transform-test/mocha-rfc232.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupTest } from 'ember-mocha';

describe('Unit | Transform | foo', function() {
setupTest();

// Replace this with your real tests.
it('exists', function() {
let transform = this.owner.lookup('transform:foo');
expect(transform).to.be.ok;
});
});