Skip to content

bappasahabapi/testing-vitest-01

Repository files navigation

01-Basic Setup

  • To run the tests -yarn test --

  • Install a brand new project - yarn init -y - yarn add vitest -D

  • To run the test case first write a script file in the package json.

{
  "name": "Vitest-01",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "scripts": {
    "test": "vitest"
  },
  "devDependencies": {
    "vitest": "^0.34.6"
  }
}

  • To run the tests -yarn test

02-AAA Pattern

  • Arrange the data
  • Perform the action
  • Evaluate the expectations

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published