-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 #4691 from Turbo87/mocha-blueprints
[BUGFIX beta] Add blueprints for "ember-cli-mocha >= 0.12.0"
- Loading branch information
Showing
10 changed files
with
178 additions
and
1 deletion.
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, | ||
})); | ||
}; |