Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Use addModuleIncludeMatcher instead of prototype mutation. #77

Merged
merged 1 commit into from
Sep 11, 2015
Merged
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
15 changes: 12 additions & 3 deletions vendor/ember-cli-qunit/test-loader.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
/* globals jQuery,QUnit */

jQuery(document).ready(function() {
var TestLoader = require('ember-cli/test-loader')['default'];
TestLoader.prototype.shouldLoadModule = function(moduleName) {
var TestLoaderModule = require('ember-cli/test-loader');
var TestLoader = TestLoaderModule['default'];
var addModuleIncludeMatcher = TestLoaderModule['addModuleIncludeMatcher'];

function moduleMatcher(moduleName) {
return moduleName.match(/\/.*[-_]test$/) || (!QUnit.urlParams.nojshint && moduleName.match(/\.jshint$/));
};
}

if (addModuleIncludeMatcher) {
addModuleIncludeMatcher(moduleMatcher);
} else {
TestLoader.prototype.shouldLoadModule = moduleMatcher;
}

TestLoader.prototype.moduleLoadFailure = function(moduleName, error) {
QUnit.module('TestLoader Failures');
Expand Down