Skip to content

no Jest preset installed with 7.2.0 #719

Closed
@githorse

Description

@githorse

Describe the bug

After installing the package with yarn add -D @testing-library/react-native, and adding the custom Jest preset line in jest.config.js, I get this error:

yarn run v1.22.10
$ jest
● Validation Error:

  Module @testing-library/react-native should have "jest-preset.js" or "jest-preset.json" file at the root.

  Configuration Documentation:
  https://jestjs.io/docs/configuration.html

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Sure enough, there's no jest-preset anything in node_modules/@testing-library/react-native:

$ ls -a node_modules/@testing-library/react-native
.
..
build
dont-cleanup-after-each.js
LICENSE
node_modules
package.json
pure.js
README.md
typings

Expected behavior

Jest preset should be available (even if maybe it doesn't fix the timer thing).

I've deleted node_modules and re-installed, no change. What am I doing wrong here?

Steps to Reproduce

$ yarn add -D @testing-library/react-native
$ yarn test

Versions

  npmPackages:
    @testing-library/react-native: ^7.2.0 => 7.2.0 
    react: 17.0.1 => 17.0.1 
    react-native: 0.64.0 => 0.64.0 
    react-test-renderer: 17.0.1 => 17.0.1 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions