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

Default the template helper test blueprint to integration style #14970

Merged
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
6 changes: 3 additions & 3 deletions blueprints/helper-test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = useTestFrameworkDetector({
{
name: 'test-type',
type: ['integration', 'unit'],
default: 'unit',
default: 'integration',
aliases: [
{ 'i': 'integration' },
{ 'u': 'unit' },
Expand All @@ -25,13 +25,13 @@ module.exports = useTestFrameworkDetector({
fileMapTokens: function() {
return {
__testType__: function(options) {
return options.locals.testType || 'unit';
return options.locals.testType || 'integration';
}
};
},

locals: function(options) {
var testType = options.testType || 'unit';
var testType = options.testType || 'integration';
var testName = testType === 'integration' ? 'Integration' : 'Unit';
var friendlyTestName = testInfo.name(options.entity.name, testName, 'Helper');

Expand Down
56 changes: 28 additions & 28 deletions node-tests/blueprints/helper-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ describe('Acceptance: ember generate and destroy helper', function() {
"}\n\n" +
"export default Ember.Helper.helper(fooBarBaz);");

expect(_file('tests/unit/helpers/foo/bar-baz-test.js'))
.to.contain("import { fooBarBaz } from 'my-app/helpers/foo/bar-baz';");
expect(_file('tests/integration/helpers/foo/bar-baz-test.js'))
.to.contain("moduleForComponent('foo/bar-baz', 'helper:foo/bar-baz', {");
}));
});

Expand All @@ -46,8 +46,8 @@ describe('Acceptance: ember generate and destroy helper', function() {

expect(_file('app/helpers/foo-bar.js'))
.to.contain("export { default, fooBar } from 'my-addon/helpers/foo-bar';");
expect(_file('tests/unit/helpers/foo-bar-test.js'))
.to.contain("import { fooBar } from 'dummy/helpers/foo-bar';");
expect(_file('tests/integration/helpers/foo-bar-test.js'))
.to.contain("moduleForComponent('foo-bar', 'helper:foo-bar', {");
}));
});

Expand All @@ -65,8 +65,8 @@ describe('Acceptance: ember generate and destroy helper', function() {

expect(_file('app/helpers/foo/bar-baz.js'))
.to.contain("export { default, fooBarBaz } from 'my-addon/helpers/foo/bar-baz';");
expect(_file('tests/unit/helpers/foo/bar-baz-test.js'))
.to.contain("import { fooBarBaz } from 'dummy/helpers/foo/bar-baz';");
expect(_file('tests/integration/helpers/foo/bar-baz-test.js'))
.to.contain("moduleForComponent('foo/bar-baz', 'helper:foo/bar-baz', {");
}));
});

Expand All @@ -84,7 +84,7 @@ describe('Acceptance: ember generate and destroy helper', function() {

expect(_file('app/helpers/foo-bar.js'))
.to.not.exist;
expect(_file('tests/unit/helpers/foo-bar-test.js'))
expect(_file('tests/integration/helpers/foo-bar-test.js'))
.to.not.exist;
}));
});
Expand All @@ -103,7 +103,7 @@ describe('Acceptance: ember generate and destroy helper', function() {

expect(_file('app/helpers/foo/bar-baz.js'))
.to.not.exist;
expect(_file('tests/unit/helpers/foo/bar-baz-test.js'))
expect(_file('tests/integration/helpers/foo/bar-baz-test.js'))
.to.not.exist;
}));
});
Expand All @@ -122,8 +122,8 @@ describe('Acceptance: ember generate and destroy helper', function() {

expect(_file('lib/my-addon/app/helpers/foo-bar.js'))
.to.contain("export { default, fooBar } from 'my-addon/helpers/foo-bar';");
expect(_file('tests/unit/helpers/foo-bar-test.js'))
.to.contain("import { fooBar } from 'my-app/helpers/foo-bar';");
expect(_file('tests/integration/helpers/foo-bar-test.js'))
.to.contain("moduleForComponent('foo-bar', 'helper:foo-bar', {");
}));
});

Expand All @@ -141,8 +141,8 @@ describe('Acceptance: ember generate and destroy helper', function() {

expect(_file('lib/my-addon/app/helpers/foo/bar-baz.js'))
.to.contain("export { default, fooBarBaz } from 'my-addon/helpers/foo/bar-baz';");
expect(_file('tests/unit/helpers/foo/bar-baz-test.js'))
.to.contain("import { fooBarBaz } from 'my-app/helpers/foo/bar-baz';");
expect(_file('tests/integration/helpers/foo/bar-baz-test.js'))
.to.contain("moduleForComponent('foo/bar-baz', 'helper:foo/bar-baz', {");
}));
});

Expand All @@ -158,8 +158,8 @@ describe('Acceptance: ember generate and destroy helper', function() {
"}\n\n" +
"export default Ember.Helper.helper(fooBar);");

expect(_file('tests/unit/helpers/foo-bar-test.js'))
.to.contain("import { fooBar } from 'my-app/helpers/foo-bar';");
expect(_file('tests/integration/helpers/foo-bar-test.js'))
.to.contain("moduleForComponent('foo-bar', 'helper:foo-bar', {");
}));
});

Expand All @@ -176,8 +176,8 @@ describe('Acceptance: ember generate and destroy helper', function() {
"}\n\n" +
"export default Ember.Helper.helper(fooBar);");

expect(_file('tests/unit/helpers/foo-bar-test.js'))
.to.contain("import { fooBar } from 'my-app/helpers/foo-bar';");
expect(_file('tests/integration/helpers/foo-bar-test.js'))
.to.contain("moduleForComponent('foo-bar', 'helper:foo-bar', {");
}));
});

Expand All @@ -193,8 +193,8 @@ describe('Acceptance: ember generate and destroy helper', function() {
"}\n\n" +
"export default Ember.Helper.helper(fooBarBaz);");

expect(_file('tests/unit/helpers/foo/bar-baz-test.js'))
.to.contain("import { fooBarBaz } from 'my-app/helpers/foo/bar-baz';");
expect(_file('tests/integration/helpers/foo/bar-baz-test.js'))
.to.contain("moduleForComponent('foo/bar-baz', 'helper:foo/bar-baz', {");
}));
});

Expand All @@ -211,8 +211,8 @@ describe('Acceptance: ember generate and destroy helper', function() {
"}\n\n" +
"export default Ember.Helper.helper(fooBarBaz);");

expect(_file('tests/unit/helpers/foo/bar-baz-test.js'))
.to.contain("import { fooBarBaz } from 'my-app/helpers/foo/bar-baz';");
expect(_file('tests/integration/helpers/foo/bar-baz-test.js'))
.to.contain("moduleForComponent('foo/bar-baz', 'helper:foo/bar-baz', {");
}));
});

Expand All @@ -222,7 +222,7 @@ describe('Acceptance: ember generate and destroy helper', function() {
return emberNew()
.then(() => emberGenerateDestroy(args, _file => {
expect(_file('tests/integration/helpers/foo/bar-baz-test.js'))
.to.contain("import hbs from 'htmlbars-inline-precompile';");
.to.contain("moduleForComponent('foo/bar-baz', 'helper:foo/bar-baz', {");
}));
});

Expand All @@ -231,8 +231,8 @@ describe('Acceptance: ember generate and destroy helper', function() {

return emberNew()
.then(() => emberGenerateDestroy(args, _file => {
expect(_file('tests/unit/helpers/foo/bar-baz-test.js'))
.to.contain("import { fooBarBaz } from 'my-app/helpers/foo/bar-baz';");
expect(_file('tests/integration/helpers/foo/bar-baz-test.js'))
.to.contain("moduleForComponent('foo/bar-baz', 'helper:foo/bar-baz', {");
}));
});

Expand All @@ -241,8 +241,8 @@ describe('Acceptance: ember generate and destroy helper', function() {

return emberNew({ target: 'addon' })
.then(() => emberGenerateDestroy(args, _file => {
expect(_file('tests/unit/helpers/foo-bar-test.js'))
.to.contain("import { fooBar } from 'dummy/helpers/foo-bar';");
expect(_file('tests/integration/helpers/foo-bar-test.js'))
.to.contain("moduleForComponent('foo-bar', 'helper:foo-bar', {");
}));
});

Expand Down Expand Up @@ -290,10 +290,10 @@ describe('Acceptance: ember generate and destroy helper', function() {
]))
.then(() => generateFakePackageManifest('ember-cli-mocha', '0.12.0'))
.then(() => emberGenerateDestroy(args, _file => {
expect(_file('tests/unit/helpers/foo/bar-baz-test.js'))
expect(_file('tests/integration/helpers/foo/bar-baz-test.js'))
.to.contain("import { describe, it } from 'mocha';")
.to.contain("import { fooBarBaz } from 'my-app/helpers/foo/bar-baz';")
.to.contain("describe('Unit | Helper | foo/bar baz', function() {");
.to.contain("setupComponentTest('foo/bar-baz', {")
.to.contain("describe('Integration | Helper | foo/bar baz', function() {");
}));
});
});