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.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

jsdom-runner

run browser tests or scripts within an emulated DOM

Usage

This library is intended to run any script from NodeJs inside an emulated DOM provided by jsdom. Script is read from standard input and results are displayed to standard output or standard error by connecting the jsdom console to NodeJs console.

For example Tape results are directed to stdout. 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.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 19 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