Giter VIP home page Giter VIP logo

enzyme-example-jest's Introduction

enzyme-example-jest

Example project with React + Enzyme + Jest

Install

  1. Clone the repo
  2. From the project's root directory, run npm install

Run Tests

    npm test

Credits

The original example, written by Leland Richardson, can be found at https://github.com/lelandrichardson/enzyme-example-jest.

enzyme-example-jest's People

Contributors

lelandrichardson avatar vjwilson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

enzyme-example-jest's Issues

No setupTests.js File

It looks like this repository is no longer maintained, but just in case someone is still reading this, it would be nice if the Enzyme/Jest test example actually followed the Enzyme/Jest instructions, which:

  1. Use a jest.config.js file (the example doesn't)
  2. Add a setupTestFrameworkScriptFile entry to that config, and have it point to a setupTests.js file (the example also lacks this file)
  3. require in both enzyme.configure and enzyme-adapter-react-16 (or a different adapter for older Reacts)
  4. Call configure and pass it a new enzyme-adapter-react-16 adapter.

Honestly getting all that setup right seems more difficult (and thus more in need of a proper example) than the stuff the example does demonstrate.

Line 16 of test file has syntax error

Hello!
I was reading through the documentation and while taking a look at the tests I found this little bugger:
expect(mount(<Foo />).find('.foo').length).toBe(1); where length should be length() ? Im more than happy to fix it. Its tiny. Like me.

Does not work

You only have one test "expect(true).toBe(true);"

As soon as I uncomment the "expect(shallow..." lines it breaks with various errors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.