Created
July 1, 2016 18:42
-
-
Save marr/e95e1f9cf3b8d75b9320bda71565107a 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
| // Print all of the news items on Hacker News | |
| var jsdom = require('jsdom') | |
| var fs = require('fs') | |
| var app = fs.readFileSync('./dist/main.js', 'utf-8') | |
| var html = '<div id="root"></div>' | |
| jsdom.env(html, { | |
| src: [app], | |
| virtualConsole: jsdom.createVirtualConsole().sendTo(console), | |
| done: function (err, window) { | |
| if (err) { | |
| console.error(err) | |
| } | |
| console.log('Loaded Fulfillment Experiment') | |
| console.log(window.document.getElementById('root')) | |
| } | |
| }) |
Author
marr
commented
Jul 1, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment