Test driven development

vitest

Blazing Fast Unit Test Framework.
A Vite-native unit test framework. It's fast!

API reference

Basic test

import { expect, test } from 'vitest'
      
test('should work as expected', () => {
  expect(Math.sqrt(4)).toBe(2)
})


node v18.0 test runner

API reference

Basic test

import test from 'node:test';
import { strict as assert } from 'node:assert';
          
test('synchronous passing test', (t) => {
  // This test passes because it does not throw an exception.
  assert.strictEqual(1, 1);
});