-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[BUGFIX beta] Add blueprints for "ember-cli-mocha >= 0.12.0" #4691
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
blueprints/adapter-test/mocha-0.12-files/tests/unit/__path__/__test__.js
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { expect } from 'chai'; | ||
import { describe, it } from 'mocha'; | ||
import { setupTest } from 'ember-mocha'; | ||
|
||
describe('<%= friendlyTestDescription %>', function() { | ||
setupTest('adapter:<%= dasherizedModuleName %>', { | ||
// Specify the other units that are required for this test. | ||
// needs: ['serializer:foo'] | ||
}); | ||
|
||
// Replace this with your real tests. | ||
it('exists', function() { | ||
let adapter = this.subject(); | ||
expect(adapter).to.be.ok; | ||
}); | ||
}); |
17 changes: 17 additions & 0 deletions
17
blueprints/model-test/mocha-0.12-files/tests/unit/__path__/__test__.js
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { expect } from 'chai'; | ||
import { describe, it } from 'mocha'; | ||
import { setupModelTest } from 'ember-mocha'; | ||
|
||
describe('<%= friendlyDescription %>', function() { | ||
setupModelTest('<%= dasherizedModuleName %>', { | ||
// Specify the other units that are required for this test. | ||
<%= typeof needs !== 'undefined' ? needs : '' %> | ||
}); | ||
|
||
// Replace this with your real tests. | ||
it('exists', function() { | ||
let model = this.subject(); | ||
// var store = this.store(); | ||
expect(model).to.be.ok; | ||
}); | ||
}); |
19 changes: 19 additions & 0 deletions
19
blueprints/serializer-test/mocha-0.12-files/tests/unit/__path__/__test__.js
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { expect } from 'chai'; | ||
import { describe, it } from 'mocha'; | ||
import { setupModelTest } from 'ember-mocha'; | ||
|
||
describe('<%= friendlyTestDescription %>', function() { | ||
setupModelTest('<%= dasherizedModuleName %>', { | ||
// Specify the other units that are required for this test. | ||
needs: ['serializer:<%= dasherizedModuleName %>'] | ||
}); | ||
|
||
// Replace this with your real tests. | ||
it('serializes records', function() { | ||
let record = this.subject(); | ||
|
||
let serializedRecord = record.serialize(); | ||
|
||
expect(serializedRecord).to.be.ok; | ||
}); | ||
}); |
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
16 changes: 16 additions & 0 deletions
16
blueprints/transform-test/mocha-0.12-files/tests/unit/__path__/__test__.js
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { expect } from 'chai'; | ||
import { describe, it } from 'mocha'; | ||
import { setupTest } from 'ember-mocha'; | ||
|
||
describe('<%= friendlyTestDescription %>', function() { | ||
setupTest('transform:<%= dasherizedModuleName %>', { | ||
// Specify the other units that are required for this test. | ||
// needs: ['transform:foo'] | ||
}); | ||
|
||
// Replace this with your real tests. | ||
it('exists', function() { | ||
let transform = this.subject(); | ||
expect(transform).to.be.ok; | ||
}); | ||
}); |
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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var fs = require('fs'); | ||
|
||
module.exports = function generateFakePackageManifest(name, version) { | ||
if (!fs.existsSync('node_modules')) { | ||
fs.mkdirSync('node_modules'); | ||
} | ||
if (!fs.existsSync('node_modules/' + name)) { | ||
fs.mkdirSync('node_modules/' + name); | ||
} | ||
fs.writeFileSync('node_modules/' + name + '/package.json', JSON.stringify({ | ||
version: version, | ||
})); | ||
}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the check for
/mocha-0.12-files
necessary`? Shouldn't this be the case when the addon of this version is installed?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pangratz that check allows us to have some blueprints that care about the Mocha version and others that don't. This is not technically needed in this case, but I've reused the code from emberjs/ember.js#14670 to reduce differences.