Skip to content

Differences between (Jest + Enzime) vs (Mocha + chaiJquery) on a React Redux sample app

Notifications You must be signed in to change notification settings

carlosvini/redux-mocha-vs-jest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jest + Enzime vs Mocha + chaiJquery

  • version with Mocha + chaiJquery

  • version with Jest + Enzime

    • /src/__tests__
    • created by Facebook (Jest) and Airbnb (Enzime)
    • default on Create React App

Useful links

Sample code

    beforeEach(() => {
        component = renderComponent(WelcomePage);
    });

    it('renders text ', () => {
        expect(component).to.contain('Example list of languages');
    });
    
    it('when submitted, clears the input', () => {
        component.simulate('submit');
        expect(component.find('input:text')).to.have.value('');
    });
    beforeEach(() => {
        component = mountWithRedux(<WelcomePage />);
    });

    it('renders text ', () => {
        expect(component.text()).toContain('Example list of languages');
    });
    
    it('when submitted, clears the input', () => {
        component.simulate('submit');
        // Enzime does not have pseudo-class CSS selector yet
        // So we cant use input:text
        expect(component.find('input').prop('value')).toBe('');
    });

Created with Create React App

This project was bootstrapped with Create React App.

Below you will find some information on how to perform common tasks.
You can find the most recent version of this guide here.

About

Differences between (Jest + Enzime) vs (Mocha + chaiJquery) on a React Redux sample app

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published