npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

simple-jsdom

3.0.0 • Public • Published

simple-jsdom

Travis build status

A simple JSDom configuration for testing libraries.

Installation

The easiest way to get simple-jsdom is through npm.

npm i simple-jsdom

Getting Started

To modify the global namespace, run:

require('simple-jsdom').install();

Motivation

Most of the time that I use JSDom, I only want to make it so that my client side tests work in a Node environment without blowing up. I'm less interested in thinking about how JSDom works.

I found myself copying and pasting the same code between projects, so I abstracted into this bare bones JSDom configuration. Require this in and your tests should Just Work©.

For instance, you should be able to use most (all?) of the jQuery API after you've included this.

Versioning

This library requires Node v4+ and JSDom v8+.

API

This module returns two things: a globals object, which returns the globals created by JSDom, and an install method, which attaches those things to the global namespace.

The four objects are:

  • document
  • window
  • navigator
  • jsdom

install

npm i simple-jsdom

Downloadsweekly downloads

0

version

3.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability