Git Product home page Git Product logo

antoniovizuete / examin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oslabs-beta/examin

0.0 1.0 0.0 15.62 MB

Examin is a developer tool that generates React unit tests for your application. Ensure your application renders as expected before adding new features. Examin writes the baseline unit tests and allows developers to customize their tests for their application.

Home Page: http://examin.dev

License: MIT License

HTML 0.64% JavaScript 26.66% TypeScript 72.56% CSS 0.14%

examin's Introduction

Examin Cover


Examin

Automatic React Unit Test Generator
examin.dev | Install Examin

GitHub license Version GitHub Release PRs Welcome GitHub contributors

Features ⚡

Examin is a developer tool that generates React unit tests for your application. Ensure your application renders as expected before adding new features. Examin writes the baseline unit tests and allows developers to customize their tests for their application.

  • Install the Examin extension
  • Install npm dependencies for Jest/Enzyme
  • Navigate to the Examin panel in Chrome developer tools
  • ✨ Generate tests ✨

Preview of Examin

Installation 🔌

To get started, manually install Examin in Developer mode.

  1. Clone the repo
    git clone https://github.com/oslabs-beta/Examin.git
  2. Install NPM packages
    npm install
  3. Create a build directory
    npm run build
  4. Load the unpacked extension from src/extension to Chrome

NOTE: The React Developer Tools extension is also required for Examin to run, if you do not already have it installed on your browser.

How to Use ❓️

  1. Install Jest/Enzyme for your project

    • npm install jest enzyme enzyme-adapter-react-16 @babel/core @babel/preset-env
    • Add presets to your .babelrc file
      { "presets": ["@babel/preset-env", "@babel/preset-react"] }
  2. Run the Examin build using npm run dev

  3. Navigate to the Examin panel in Chrome DevTools

    • Must be in developer mode
    • Revise import statements as needed
  4. Add Generated tests into your application

    • Add __tests__ directory in root directory
    • Add test js file to __tests__ directory
    • Run tests using jest or jest <filename>


Editing Import Statements Demo Gif

  • Editing import statements


State Change and Component Selection Demo Gif

  • Updating tests with state changes
  • Selecting components for generated tests

Compatibility

  • Requires React v16.8.0 or higher
  • Functional components + React hooks
  • Not yet compatible with component libraries or Context API

Troubleshooting ⁉️

  • Jest docs
  • Enzyme docs
  • Error: Unable to resolve dependency tree while installing enzyme-adapter-react-16
    • Add peerDependencies to your package.json file
      "peerDependencies": { "react": "^16.8.0 || ^17.0.0", "react-dom": "^16.8.0 || ^17.0.0" }

Contributing

Examin is open source on Github through the tech accelerator umbrella OS Labs. Please read the contribution documentation to learn more on how you can participate in improvements.

Core Team ☕ 💼

examin's People

Contributors

tdoan35 avatar kirstenyoon avatar njbrush avatar wizardsource avatar

Watchers

James Cloos avatar

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.