3.0.0 • Published 8 years ago

simple-jsdom v3.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

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
3.0.0

8 years ago

2.0.0

8 years ago

1.0.0

8 years ago

0.0.2

9 years ago

0.0.1

9 years ago