Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jsdom-runner

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsdom-runner

run browser tests within an emulated DOM

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

jsdom-runner

run browser tests within an emulated DOM

Usage

jsdom-runner take a stream as an input and write to standard outputs. The input stream should be a js script to run in a browser env.

The output depends on your test library: browser console is redirected to Node consoleconsole.

For example Tape write to stderr. So any test library or script writing to the console should work.

Example

test.js:

var test = require('tape');
 
test('demo', function (t) {
	t.equal(1+1, 2)
	t.end()
})

Then build it and run the test:

browserify test/test.js | jsdom-runner

API

var runner = require('jsdom-runner')

runner(pageOptions, jsdomOptions)

Returns a writable stream. Pipe your js code into it.

  • pageOptions: options for create-html module, documentation is here
  • jsdomOptions: options for jsdom instance, documentation is here

Install

npm install -g jsdom-runner

But --save-dev option should suffice!

Similar projects

Keywords

FAQs

Package last updated on 18 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc