This repository has been archived by the owner on Dec 10, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates to match ember-cli-qunit 0.2.0 and 0.3.0 changes.
- Loading branch information
Showing
6 changed files
with
41 additions
and
24 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 |
---|---|---|
@@ -1,25 +1,4 @@ | ||
/* globals require, mocha */ | ||
import resolver from './helpers/resolver'; | ||
import { setResolver } from 'ember-mocha'; | ||
|
||
setResolver(resolver); | ||
|
||
document.write('<div id="ember-testing-container"><div id="ember-testing"></div></div>'); | ||
|
||
$(document).ready(function(){ | ||
// Rename elements from qunit -> mocha | ||
$('#qunit').attr('id', 'mocha'); | ||
$('#qunit-fixture').attr('id', 'mocha-fixture'); | ||
|
||
// Declare `expect` as a global here instead of as a var in individual tests. | ||
// This avoids jshint warnings re: `Redefinition of 'expect'`. | ||
window.expect = chai.expect; | ||
|
||
var TestLoader = require('ember-cli/test-loader')['default']; | ||
TestLoader.prototype.shouldLoadModule = function(moduleName) { | ||
return moduleName.match(/[-_]test$/) || moduleName.match(/\.jshint$/); | ||
}; | ||
TestLoader.load(); | ||
|
||
mocha.run(); | ||
}); |
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
<div id="qunit"></div> | ||
<div id="qunit-fixture"></div> | ||
<div id="mocha"></div> | ||
<div id="mocha-fixture"></div> | ||
|
||
<div id="ember-testing-container"> | ||
<div id="ember-testing"></div> | ||
</div> |
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,14 @@ | ||
#ember-testing-container { | ||
position: absolute; | ||
background: white; | ||
bottom: 0; | ||
right: 0; | ||
width: 640px; | ||
height: 384px; | ||
overflow: auto; | ||
z-index: 9999; | ||
border: 1px solid #ccc; | ||
} | ||
#ember-testing { | ||
zoom: 50%; | ||
} |
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,chai,mocha */ | ||
|
||
jQuery(document).ready(function() { | ||
// Declare `expect` as a global here instead of as a var in individual tests. | ||
// This avoids jshint warnings re: `Redefinition of 'expect'`. | ||
window.expect = chai.expect; | ||
|
||
var TestLoader = require('ember-cli/test-loader')['default']; | ||
TestLoader.prototype.shouldLoadModule = function(moduleName) { | ||
return moduleName.match(/[-_]test$/) || moduleName.match(/\.jshint$/); | ||
}; | ||
TestLoader.load(); | ||
|
||
mocha.run(); | ||
}); |