Giter Club home page Giter Club logo

react-testing's Introduction

React Testing Examples

This repository provides an example of testing setup for React applications.

The following libraries are used:

Start application locally

To start a local back end API execute the following command in your terminal:

npm run server

API will be available at http://localhost:3000/, you can change the dataset by editing ./src/server/db.json file.

To start client application (available at http://localhost:5173/) please execute:

npm run dev

Both client and server apps should be running to use application locally!

Testing (default mode)

npm run test

Runs all of the available tests, showing results in the terminal. Runs in watch mode by default, waiting for the code changes to re-run the tests.

Testing (UI mode)

npm run test:ui

Starts a local web server at http://localhost:51204/**vitest**/#/ with a user-friendly UI that allows manual interaction with the test suite

Testing (coverage)

npm run coverage

Generates coverage report available at ./coverage/index.html

Vitest Preview

npm run vitest-preview

Previews are avaliable at http://localhost:5006/

import { debug } from 'vitest-preview';

// Inside your tests
describe('my test', () => {
  render(<MyComponent />);
  debug(); // ๐Ÿ‘ˆ Add this line
}

react-testing's People

Contributors

s-yakymuk avatar

Watchers

 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.