2.1.1 • Published 1 year ago

@ta-interaktiv/jest-preset v2.1.1

Weekly downloads
81
License
ISC
Repository
gitlab
Last release
1 year ago

Jest Preset

Jest Preset for testing React components, using React 16, Enzyme and Jest-Enzyme.

Installation

yarn add jest @ta-interaktiv/jest-preset --dev

Usage

Add to package.json:

  "jest": {
    "preset": "@ta-interaktiv/jest-preset"
  }

and, if necessary, under scripts:

"test": "jest"

Manipulating the virtual browser environment

Jest uses JSDOM to simulate a browser environment to test React components in.

In cases where the window.location is relevant for testing, it is set up to use https://interaktiv.tagesanzeiger.ch/2018/test-project/index .html#anchor – which, hopefully, should cover most bases.

You can change this property as follows:

jsdom.reconfigure({url: 'https://new.url.com/to-use.html#with-hash-if-needed'})

See in the enclosed __tests__/index.js how this works.

2.1.1

1 year ago

2.1.0

1 year ago

2.0.0

5 years ago

1.8.1

5 years ago

1.8.0

5 years ago

1.7.4

6 years ago

1.7.3

6 years ago

1.7.2

6 years ago

1.7.0

6 years ago

1.6.1

6 years ago

1.6.0

6 years ago

1.5.0

6 years ago

1.4.5

6 years ago

1.4.4

6 years ago

1.4.3

6 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago

0.1.0

7 years ago