21.2.2 • Published 7 years ago

@mediaeventservices/jest-environment-jsdom-external-scripts v21.2.2

Weekly downloads
18
License
MIT
Repository
github
Last release
7 years ago

jest-environment-jsdom-external-scripts

A Jest environment which loads and runs external scripts

Install

$ npm install --save-dev @mediaeventservices/jest-environment-jsdom-external-scripts

Usage

In package.json:

"scripts": {
  "test": "jest prefix --env @mediaeventservices/jest-environment-jsdom-external-scripts"
},

Motivation

Loading and execution of external scripts is not enabled by default in JSDom, and Jest currently does not expose a way to control this setting.

This environment adds the following two JSDom config options on initialization: { runScripts: "dangerously", resources: "usable" }

The build script is as close as possible from the one of Facebook's Jest repo. More on Jest environments: http://facebook.github.io/jest/docs/configuration.html#testenvironment-string(http://facebook.github.io/jest/docs/configuration.html#testenvironment-string

Credits

Based on jest-environment-jsdom-latest by Damien Seguin

License

MIT © MediaEvent Services GmbH & Co. KG, originally Damien Seguin

21.2.2

7 years ago

21.2.1

7 years ago