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

[FEATURE] Updated blueprints to account for new mocha syntax #441

Merged
merged 1 commit into from
Jan 24, 2017
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
10 changes: 9 additions & 1 deletion blueprints/validator-test/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
var path = require('path');
var fs = require('fs');

var VersionChecker = require('ember-cli-version-checker');
var existsSync = require('exists-sync');
var walkSync = require('walk-sync');

Expand All @@ -22,7 +24,13 @@ module.exports = {
_filesPath: function() {
var type;
if ('ember-cli-mocha' in this.project.addonPackages) {
type = 'mocha';
// Thank you @Turbo87 https://github.com/emberjs/ember.js/pull/14670
var checker = new VersionChecker({ project: this.project });
if (fs.existsSync(this.path + '/mocha-0.12-files') && checker.for('ember-cli-mocha', 'npm').satisfies('>=0.12.0')) {
type = 'mocha-0.12';
} else {
type = 'mocha';
}
} else if ('ember-cli-qunit' in this.project.addonPackages) {
type = 'qunit';
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* jshint expr:true */
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { setupTest } from 'ember-mocha';

describe('<%= classifiedModuleName %>Validator', function() {
setupTest('validator:<%= dasherizedModuleName %>', {
// Specify the other units that are required for this test.
needs: ['validator:messages']
});

// Replace this with your real tests.
it('exists', function() {
const validator = this.subject();
expect(validator).to.be.ok;
});
});