UT Test Library

raw JSON →
6.1.17 verified Sat Apr 25 auth: no javascript

A testing library for the UT framework, providing utilities for unit and integration testing. The current stable version is 6.1.17, with infrequent releases. It is designed primarily for use within the UT ecosystem, differentiating itself by tight integration with UT's module system and conventions. Not intended for general-purpose testing outside of UT projects.

error Cannot find module 'ut-test'
cause Package not installed or wrong import path.
fix
Run npm install ut-test and use correct import syntax.
error require is not defined in ES module scope
cause Using require() with ESM-only package.
fix
Switch to import statements.
breaking ESM only since v2
fix Use import syntax instead of require.
gotcha No browser support
fix Only use in Node.js environment.
deprecated someFunction is deprecated and will be removed in v7
fix Use newFunction instead.
npm install ut-test
yarn add ut-test
pnpm add ut-test

Shows basic test structure using describe, test, and expect from ut-test.

import { test, describe, expect } from 'ut-test';

describe('example', () => {
  test('should work', () => {
    expect(1 + 1).toBe(2);
  });
});