1.7.4 • Published 19 days ago

jest-preset-kyt-enzyme v1.7.4

Weekly downloads
2,368
License
Apache-2.0
Repository
-
Last release
19 days ago

jest-preset-kyt-enzyme

Jest preset for React projects that use Enzyme to test.

Installation

$ yarn add --dev jest enzyme jest-preset-kyt-enzyme

// or

$ npm i --save-dev --save-exact jest enzyme jest-preset-kyt-enzyme

Setup

In your local Jest config - for instance, jest.config.js:

{
  preset: 'jest-preset-kyt-enzyme'
}

Features:

  • Automatically installs and configures enzyme-adapter-react-16
  • Installs and adds enzyme-to-json/serializer to snapshotSerializers.
  • Installs and sets testEnvironment to jest-environment-jsdom-global, giving you access to the global jsdom object in your tests. This is useful if you want to call jsdom.reconfigure(opts) in an arbitrary test file.
  • Installs and configures raf/polyfill, which is required by React 16.
  • Automatic moduleNameMapper entries/file-stubbing for files with these extensions:
    css|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga|ico|md
  • Sets cacheDirectory to <rootDir>/.caches/jest, which allows you to build/restore Jest transforms in between CI/CD pipeline runs. Example: using drone/gcs-cache:

    steps:
      - name: restore_cache
        image: homerovalle/drone-gcs-cache:latest
        settings:
          bucket: your-custom-name
          restore: true
        environment:
          GCS_CACHE_JSON_KEY:
            from_secret: a_secret_set_by_you
    
      - name: test
        image: node:12.16.2
        commands:
          - yarn test-coverage-ci
    
      - name: rebuild_cache
        image: homerovalle/drone-gcs-cache:latest
        settings:
          bucket: your-custom-name
          mount:
            - .caches
            - coverage
          rebuild: true
        environment:
          GCS_CACHE_JSON_KEY:
            from_secret: a_secret_set_by_you
1.7.5-alpha.32

19 days ago

1.7.5-alpha.31

20 days ago

1.7.5-alpha.28

22 days ago

1.7.4

3 years ago

1.7.3

3 years ago

1.7.2

3 years ago

1.7.1

3 years ago

1.6.0

3 years ago

1.7.0

3 years ago

1.4.5

3 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.5.0

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.8

3 years ago

1.3.7

3 years ago

1.3.6

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.5

3 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

1.0.0-beta.40.1

4 years ago

1.0.0-beta.40.0

4 years ago

1.0.0-beta.39

4 years ago

1.0.0-beta.38

4 years ago

1.0.0-beta.37

4 years ago

1.0.0-beta.36

4 years ago

1.0.0-beta.35

4 years ago

1.0.0-beta.34

4 years ago

1.0.0-beta.33

4 years ago

1.0.0-beta.32

4 years ago

1.0.0-beta.31

4 years ago

1.0.0-beta.29

4 years ago

1.0.0-beta.30

4 years ago

1.0.0-beta.26

4 years ago

1.0.0-beta.27

4 years ago

1.0.0-beta.24

4 years ago

1.0.0-beta.5

4 years ago

1.0.0-beta.4

4 years ago

1.0.0-beta.0

4 years ago

1.0.0-beta.1

4 years ago

1.0.0-alpha.15

4 years ago

1.0.0-alpha.18

4 years ago

1.0.0-alpha.17

4 years ago

1.0.0-hot.18

4 years ago

1.0.0-hot.17

4 years ago

1.0.0-hot.16

4 years ago

1.0.0-hot.15

4 years ago

1.0.0-alpha.9

4 years ago

1.0.0-alpha.8

4 years ago

1.0.0-alpha.7

4 years ago

1.0.0-alpha.6

4 years ago

1.0.0-alpha.10

4 years ago

1.0.0-alpha.5

4 years ago

1.0.0-alpha.4

4 years ago

1.0.0-alpha.3

4 years ago

1.0.0-alpha.2

4 years ago

1.0.0-alpha.1

4 years ago

1.0.0-alpha.11

4 years ago

0.9.1-alpha.0

4 years ago

1.0.0-alpha.0

4 years ago