Skip to content

Commit

Permalink
docs(requirejs): update example to work on IE9
Browse files Browse the repository at this point in the history
As this file is loaded into the browser, it must not contain any ES5-only methods/functionality. It's still very common to need tests for IE 8 & 7 and this code is currently causing an error in those.
  • Loading branch information
shakyShane authored and vojtajina committed Jul 13, 2013
1 parent 9829504 commit 1d04dab
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docs/plus/02-RequireJS.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,14 @@ asynchronously as dependencies must be fetched before the tests are run.
The `test/main-test.js` file ends up looking like this:

```javascript
var tests = Object.keys(window.__karma__.files).filter(function (file) {
return /Spec\.js$/.test(file);
});
var tests = [];
for (var file in window.__karma__.files) {
if (window.__karma__.files.hasOwnProperty(file)) {
if (/Spec\.js$/.test(file)) {
tests.push(file);
}
}
}

requirejs.config({
// Karma serves files from '/base'
Expand Down

0 comments on commit 1d04dab

Please sign in to comment.