Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: virtualConsole must be an instance of VirtualConsole #76

Open
niftylettuce opened this issue Jun 17, 2019 · 1 comment
Open

Comments

@niftylettuce
Copy link

It seems all options passed to jsdom work except virtualConsole.

const browserEnv = require('browser-env');
const { VirtualConsole, CookieJar } = require('jsdom');

const cookieJar = new CookieJar();
const virtualConsole = new VirtualConsole();

virtualConsole.sendTo(console);

browserEnv({
  url: 'http:https://localhost:3000/',
  referrer: 'http:https://localhost:3000/',
  contentType: 'text/html',
  includeNodeLocations: true,
  resources: 'usable',
  runScripts: 'dangerously',
  virtualConsole,
  cookieJar
});
  Uncaught exception in test/browser-env.js

  /Users/user/Projects/parse-request/node_modules/window/node_modules/jsdom/lib/api.js:263

  TypeError: virtualConsole must be an instance of VirtualConsole

  transformOptions (node_modules/window/node_modules/jsdom/lib/api.js:263:11)
  new JSDOM (node_modules/window/node_modules/jsdom/lib/api.js:36:15)
  new Window (node_modules/window/src/index.js:13:11)
  browserEnv (node_modules/browser-env/src/index.js:28:17)
  Object.browserEnv (test/browser-env.js:12:1)

  ✖ test/browser-env.js exited with a non-zero exit code: 1
@lukechilds
Copy link
Owner

Thanks for taking the time to report this but unfortunately I don't have time to look into this right now due to paid work.

PRs are very welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants