-
Notifications
You must be signed in to change notification settings - Fork 2k
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 #686 from wycats/amd-tests
Falsy AMD module names in version 1.2.0
- Loading branch information
Showing
4 changed files
with
2,130 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
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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<html> | ||
<head> | ||
<title>Mocha</title> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|
||
<link rel="stylesheet" href="/node_modules/mocha/mocha.css" /> | ||
<style> | ||
.headless .suite > h1, | ||
.headless .test.pass { | ||
display: none; | ||
} | ||
</style> | ||
|
||
<script> | ||
// Show only errors in "headless", non-interactive mode. | ||
if (/headless=true/.test(location.href)) { | ||
document.documentElement.className = 'headless'; | ||
} | ||
</script> | ||
<script src="/node_modules/mocha/mocha.js"></script> | ||
<script> | ||
mocha.setup('bdd'); | ||
</script> | ||
|
||
<script src="/spec/env/require.js"></script> | ||
|
||
<script src="/spec/env/common.js"></script> | ||
<script> | ||
requirejs.config({ | ||
paths: { | ||
handlebars: '/dist/handlebars.amd', | ||
tests: '/tmp/tests' | ||
} | ||
}); | ||
|
||
var CompilerContext = { | ||
compile: function(template, options) { | ||
var templateSpec = handlebarsEnv.precompile(template, options); | ||
return handlebarsEnv.template(safeEval(templateSpec)); | ||
}, | ||
compileWithPartial: function(template, options) { | ||
return handlebarsEnv.compile(template, options); | ||
} | ||
}; | ||
|
||
function safeEval(templateSpec) { | ||
var ret; | ||
eval('ret = ' + templateSpec); | ||
return ret; | ||
} | ||
</script> | ||
<script> | ||
onload = function(){ | ||
|
||
require(['handlebars'], function(Handlebars) { | ||
window.Handlebars = Handlebars['default']; | ||
|
||
require(['tests'], function(Handlebars) { | ||
// The test harness leaks under FF. We should have decent global leak coverage from other tests | ||
if (!navigator.userAgent.match(/Firefox\/([\d.]+)/)) { | ||
mocha.checkLeaks(); | ||
} | ||
mocha.run(); | ||
}); | ||
}); | ||
}; | ||
</script> | ||
</head> | ||
<body> | ||
<div id="mocha"></div> | ||
</body> | ||
</html> |
Oops, something went wrong.