Skip to content

Commit

Permalink
Fix parts of the test
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronDewes committed Feb 18, 2021
1 parent 88a3bae commit cfb86d8
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions test/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const fs = require('fs');
const jsdom = require('jsdom');
const { JSDOM } = jsdom;
const events = require('events');

describe('browser application', () => {
Expand Down Expand Up @@ -50,17 +51,21 @@ describe('browser application', () => {
const ansiup = fs.readFileSync('./web/assets/ansi_up.js', 'utf-8');
const src = fs.readFileSync('./web/assets/app.js', 'utf-8');

jsdom.env({
html,
const dom = new JSDOM(html, {
url: 'http://localhost?filter=line.*',
src: [ansiup, src],
onload: (domWindow) => {
window = domWindow;

initApp();
done();
},
runScripts: "dangerously"
});
const domWindow = dom.window;
domWindow.onload = (domWindow) => {
window = domWindow;
}
domWindow.eval(ansiup);
domWindow.eval(src);
domWindow.onload = () => {
console.log("Loaded");
initApp();
done();
}
});

it('should show lines from socket.io', () => {
Expand Down

0 comments on commit cfb86d8

Please sign in to comment.