This package has been deprecated

Author message:

Not maintained

@olegjs/jsdom-sync

0.0.3 • Public • Published

jsdom-sync

Standard - JavaScript Style Guide

Synchronous script execution in jsdom. Made for unit tests.

By default all script in jsdom are executed in parallel. In some cases, like unit testing, simplicity is more important than performance. This is a wrapper around jsdom that feeds all script code as inline script tags, ensuring sequential execution.

const jsdomSync = require('jsdom-sync')
const document = jsdomSync(['a.js', 'b.js'])
const window = document.defaultView
// do stuff
window.close()

Notes

  • All files included in script tags inside head; use DOMContentLoaded event.
  • If you need speed from jsdom, use the callbacks or promises instead.

Package Sidebar

Install

npm i @olegjs/jsdom-sync

Weekly Downloads

1

Version

0.0.3

License

MIT

Last publish

Collaborators

  • olegjs