-
Notifications
You must be signed in to change notification settings - Fork 30
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 #63 from toddjordan/master
Add disable jscs option to qunit
- Loading branch information
Showing
4 changed files
with
32 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"directory": "vendor" | ||
} |
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 |
---|---|---|
@@ -1,16 +1,23 @@ | ||
/* jshint node: true */ | ||
'use strict'; | ||
|
||
var JSCSFilter = require('broccoli-jscs'); | ||
var jscsrcBuilder = require('./lib/jscsrc-builder'); | ||
|
||
module.exports = { | ||
name: 'ember-suave', | ||
|
||
lintTree: function(type, tree) { | ||
lintTree: function (type, tree) { | ||
var jscsOptions = this.app.options.jscsOptions || {}; | ||
jscsOptions.configPath = jscsrcBuilder(this.project); | ||
|
||
return new JSCSFilter(tree, jscsOptions); | ||
}, | ||
|
||
included: function(app) { | ||
this._super.included.apply(this, arguments); | ||
if (app.tests) { | ||
app.import('vendor/ember-suave/qunit-configuration.js', { type: 'test' }); | ||
app.import('vendor/ember-suave/test-loader.js', { type: 'test' }); | ||
} | ||
} | ||
|
||
}; |
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,4 @@ | ||
/* globals QUnit */ | ||
if (QUnit) { | ||
QUnit.config.urlConfig.push({ id: 'nojscs', label: 'Disable JSCS' }); | ||
} |
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,15 @@ | ||
/* globals jQuery, QUnit */ | ||
|
||
jQuery(document).ready(function () { | ||
var TestLoaderModule = require('ember-cli/test-loader'); | ||
var addModuleExcludeMatcher = TestLoaderModule['addModuleExcludeMatcher']; | ||
|
||
function isJscsDisabled() { return QUnit ? QUnit.urlParams.nojscs : false; } | ||
function isAJscsTest(moduleName) { return moduleName.match(/\.jscs-test$/); } | ||
function jscsModuleMatcher(moduleName) { return isJscsDisabled() && isAJscsTest(moduleName); } | ||
|
||
if (addModuleExcludeMatcher) { | ||
addModuleExcludeMatcher(jscsModuleMatcher); | ||
} | ||
|
||
}); |