Last active
November 15, 2015 18:52
-
-
Save amitaibu/156236d28adddf1c1f16 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var jsdom = require("jsdom"); | |
jsdom.env({ | |
html: "<html><body></body></html>", | |
done: function(errs, window) { | |
global.window = window; | |
module.exports = | |
(function(){ | |
window = {Date: Date}; | |
if (typeof Elm === undefined) { throw "elm-io config error: Elm is not defined. Make sure you call elm-io with a real Elm output file"} | |
if (typeof Elm.Main === undefined ) { throw "Elm.Main is not defined, make sure your module is named Main." }; | |
var worker = Elm.worker(Elm.Main); | |
})(); | |
} | |
}); |
This file contains hidden or 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
npm install jsdom | |
# You may need to adapt the path of the TestRunner | |
elm-make ./src/elm/TestRunner.elm --output tests.js | |
curl https://gist.githubusercontent.com/amitaibu/156236d28adddf1c1f16/raw/ebef859fa441f7fc05ae242bf854430c47e5b586/add_jsdom.js > add_jsdom.js | |
cat add_jsdom.js >> tests.js | |
# Run the tests | |
node ./tests.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment