To Overview

unyt-testsA unit testing framework for TypeScript and DATEX


Unyt Test Library

Test runner for backend + frontend with integrated watch mode and report file generation.

Used in UIX.

Currently supported languages:

  • TypeScript
  • JavaScript


Write Tests for TypeScript and JavaScript


import { Assert } from "unyt-tests/testing/assertions.ts";
import { Test, Timeout } from "unyt-tests/testing/test.ts"

@Test export class DatexJSONObjects {

        [1, 2, 3],
        [4, 4, 8],
        [6, 2, 8]
    sumIsCorrect(a:number, b:number, sum:number){
        Assert.equalsStrict(a+b, sum)


    async longDurationTest(){
        // test can take up to 10 minutes (10*60s) to complete

Run tests in the command line

Automatically detect tests in current working directory:

deno run -A --import-map -w

With the -w flag, the tests are run in watch mode - when you update a test file, the tests are automatically reevaluated.

As a default import map, can be used, but you can also use a different import map.

Specifying test files

deno run -Aq --import-map [IMPORT_MAP] -w testA.ts testB.js testC.js testD.dx


See <> or run

deno run -Aq --import-map [IMPORT_MAP] -h
  • --color or -c: Set the color mode of the output ("rgb", "simple", or "none")
  • --reporttype: Set the type for the report file generation, currently supported types: "junit"
  • --reportfile: Set the path for the report output. When this option is set, a report is generated after all tests are finished.
  • --watch or -w: Run in watch mode, tests get automatically executed when a test file is updated
  • --verbose or -v: verbose output for debugging purposes


You can import the testLogger from unyt-tests/core/logger.ts to show logs in the console even in watch mode.

import { testLogger } from "unyt-tests/core/logger.ts";

@Test export class MyTests {
    @Test firstTest() {


To test the test library locally, run

deno run -Aq --import-map ./importmap.local.json ./run.ts test_examples/