-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18395 from emberjs/component-tests
[BUGFIX] Use `<Nested::Invocation>` in component tests blueprint
- Loading branch information
Showing
6 changed files
with
77 additions
and
407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,20 +5,15 @@ const fs = require('fs-extra'); | |
const blueprintHelpers = require('ember-cli-blueprint-test-helpers/helpers'); | ||
const setupTestHooks = blueprintHelpers.setupTestHooks; | ||
const emberNew = blueprintHelpers.emberNew; | ||
const emberGenerate = blueprintHelpers.emberGenerate; | ||
const emberGenerateDestroy = blueprintHelpers.emberGenerateDestroy; | ||
const modifyPackages = blueprintHelpers.modifyPackages; | ||
const expectError = require('../helpers/expect-error'); | ||
|
||
const chai = require('ember-cli-blueprint-test-helpers/chai'); | ||
const expect = chai.expect; | ||
|
||
const generateFakePackageManifest = require('../helpers/generate-fake-package-manifest'); | ||
const fixture = require('../helpers/fixture'); | ||
|
||
const setupTestEnvironment = require('../helpers/setup-test-environment'); | ||
const enableModuleUnification = setupTestEnvironment.enableModuleUnification; | ||
|
||
describe('Blueprint: component-test', function() { | ||
setupTestHooks(this); | ||
|
||
|
@@ -175,155 +170,6 @@ describe('Blueprint: component-test', function() { | |
}); | ||
}); | ||
|
||
describe('in app - module unification', function() { | ||
enableModuleUnification(); | ||
|
||
beforeEach(function() { | ||
return emberNew(); | ||
}); | ||
|
||
describe('with [email protected]', function() { | ||
beforeEach(function() { | ||
modifyPackages([ | ||
{ name: 'ember-qunit', delete: true }, | ||
{ name: 'ember-cli-qunit', dev: true }, | ||
]); | ||
generateFakePackageManifest('ember-cli-qunit', '4.1.0'); | ||
}); | ||
|
||
it('component-test x-foo', function() { | ||
return emberGenerateDestroy(['component-test', 'x-foo'], _file => { | ||
expect(_file('src/ui/components/x-foo/component-test.js')).to.equal( | ||
fixture('component-test/default.js') | ||
); | ||
}); | ||
}); | ||
|
||
it('component-test x-foo --unit', function() { | ||
return expectError( | ||
emberGenerate(['component-test', 'x-foo', '--unit']), | ||
"The --unit flag isn't supported within a module unification app" | ||
); | ||
}); | ||
|
||
describe('with usePods=true', function() { | ||
beforeEach(function() { | ||
fs.writeFileSync( | ||
'.ember-cli', | ||
`{ | ||
"disableAnalytics": false, | ||
"usePods": true | ||
}` | ||
); | ||
}); | ||
|
||
it('component-test x-foo', function() { | ||
return expectError( | ||
emberGenerate(['component-test', 'x-foo']), | ||
"Pods aren't supported within a module unification app" | ||
); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('with [email protected]', function() { | ||
beforeEach(function() { | ||
modifyPackages([ | ||
{ name: 'ember-qunit', delete: true }, | ||
{ name: 'ember-cli-qunit', dev: true }, | ||
]); | ||
generateFakePackageManifest('ember-cli-qunit', '4.2.0'); | ||
}); | ||
|
||
it('component-test x-foo', function() { | ||
return emberGenerateDestroy(['component-test', 'x-foo'], _file => { | ||
expect(_file('src/ui/components/x-foo/component-test.js')).to.equal( | ||
fixture('component-test/rfc232.js') | ||
); | ||
}); | ||
}); | ||
|
||
it('component-test x-foo --unit', function() { | ||
return expectError( | ||
emberGenerate(['component-test', 'x-foo', '--unit']), | ||
"The --unit flag isn't supported within a module unification app" | ||
); | ||
}); | ||
}); | ||
|
||
describe('with [email protected]', function() { | ||
beforeEach(function() { | ||
modifyPackages([ | ||
{ name: 'ember-qunit', delete: true }, | ||
{ name: 'ember-cli-mocha', dev: true }, | ||
]); | ||
generateFakePackageManifest('ember-cli-mocha', '0.11.0'); | ||
}); | ||
|
||
it('component-test x-foo', function() { | ||
return emberGenerateDestroy(['component-test', 'x-foo'], _file => { | ||
expect(_file('src/ui/components/x-foo/component-test.js')).to.equal( | ||
fixture('component-test/mocha.js') | ||
); | ||
}); | ||
}); | ||
|
||
it('component-test x-foo --unit', function() { | ||
return expectError( | ||
emberGenerate(['component-test', 'x-foo', '--unit']), | ||
"The --unit flag isn't supported within a module unification app" | ||
); | ||
}); | ||
}); | ||
|
||
describe('with [email protected]', function() { | ||
beforeEach(function() { | ||
modifyPackages([ | ||
{ name: 'ember-qunit', delete: true }, | ||
{ name: 'ember-cli-mocha', dev: true }, | ||
]); | ||
generateFakePackageManifest('ember-cli-mocha', '0.12.0'); | ||
}); | ||
|
||
it('component-test x-foo', function() { | ||
return emberGenerateDestroy(['component-test', 'x-foo'], _file => { | ||
expect(_file('src/ui/components/x-foo/component-test.js')).to.equal( | ||
fixture('component-test/mocha-0.12.js') | ||
); | ||
}); | ||
}); | ||
|
||
it('component-test x-foo --unit', function() { | ||
return expectError( | ||
emberGenerate(['component-test', 'x-foo', '--unit']), | ||
"The --unit flag isn't supported within a module unification app" | ||
); | ||
}); | ||
}); | ||
|
||
describe('with [email protected]', function() { | ||
beforeEach(function() { | ||
modifyPackages([{ name: 'ember-qunit', delete: true }, { name: 'ember-mocha', dev: true }]); | ||
generateFakePackageManifest('ember-mocha', '0.14.0'); | ||
}); | ||
|
||
it('component-test x-foo', function() { | ||
return emberGenerateDestroy(['component-test', 'x-foo'], _file => { | ||
expect(_file('src/ui/components/x-foo/component-test.js')).to.equal( | ||
fixture('component-test/mocha-rfc232.js') | ||
); | ||
}); | ||
}); | ||
|
||
it('component-test x-foo --unit', function() { | ||
return expectError( | ||
emberGenerate(['component-test', 'x-foo', '--unit']), | ||
"The --unit flag isn't supported within a module unification app" | ||
); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('in addon', function() { | ||
beforeEach(function() { | ||
return emberNew({ target: 'addon' }) | ||
|
Oops, something went wrong.