-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
area: browserbrowser-specificbrowser-specificarea: documentationanything involving docs or mochajs.organything involving docs or mochajs.org
Description
Getting error due to module
not being defined, no tests detected because of that error in the JS file.
Windows 8.1, IE 11 & Firefox 45.0.1, Mocha 2.4.5
Works in Mocha commandline. Also works in browser if I use BDD interface instead of exports interface.
./index.html:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="./node_modules/mocha/mocha.css" />
<script src="./node_modules/mocha/mocha.js"></script>
<script>mocha.setup("exports")</script>
<script src="./test/X.js"></script>
<script>
document.addEventListener("readystatechange",function initialize(){
if (document.readyState == "interactive") {
mocha.checkLeaks()
mocha.run()
document.removeEventListener("readystatechange",initialize)
}
})
</script>
</head>
<body>
<div id="mocha"></div>
</body>
</html>
./test/X.js:
;(function(){"use strict"
module.exports = {
"foo": function bar(done) {
setTimeout(done,10)
},
"bar": function foo() {
throw new Error("FAILED TEST!")
}
}
}())
Metadata
Metadata
Assignees
Labels
area: browserbrowser-specificbrowser-specificarea: documentationanything involving docs or mochajs.organything involving docs or mochajs.org