jest-preset-edge

0.2.1-alpha.9 • Public • Published

Jest Preset Edge - Advanced Frontend Focussed Jest Configuration

Features

  • Supports CSS Modules using identity-obj-proxy.
  • Mocks all asset file requirements for e.g. images, fonts, graphql files, ...
  • Includes a mock for the native fetch() method.
  • Polyfills requestAnimationFrame() which is required by React v16.
  • Configures Date constructors to return a static data which is very helpful for snapshot testing.
  • Integrates a mock for HTML5 canvas so that API calls does not throw inside NodeJS (via JSDOM).

Excludes for Coverage

  • Excludes typical Edge Platform based application glue code files e.g. Application.js, State.js and Init.js.
  • Excludes Webpack and generic bundling/package entry points.
  • Excludes Storybook stories following the .story.js naming convention.
  • Excludes Jest tests following the .test.js naming convention or being placed inside a __tests__ folder.

Usage

Install via NPM:

npm install --save-dev jest-preset-edge

Define the preset inside your own configuration. Official docs:

module.exports = {
  "preset": "jest-preset-edge"
}

This works in a jest.config.js or in the package.json file under the jest key.

License

Apache License Version 2.0, January 2004

Copyright

Sebastian Software GmbH Logo

Copyright 2017-2018
Sebastian Software GmbH

Readme

Keywords

none

Package Sidebar

Install

npm i jest-preset-edge

Weekly Downloads

0

Version

0.2.1-alpha.9

License

Apache-2.0

Unpacked Size

5.56 kB

Total Files

10

Last publish

Collaborators

  • swernerx