TypeScript

To use EasyTest with TypeScript you need to install tsx package.

npm
yarn
pnpm
bun
npm install -D tsx

You must change a script to run tests in package.json:

package.json
{
  "scripts": {
    "test": "cross-env NODE_OPTIONS=\"--import tsx\" easytest"
  }
}

cross-env - is a package that allows you to set environment variables in a cross-platform way.

Commands to set environment variables to support TypeScript

powershell

$env:NODE_OPTIONS="--import tsx"

linux, macos

export NODE_OPTIONS="--import tsx"

cmd

set NODE_OPTIONS="--import tsx"

Now you can write tests in TypeScript and tests the TypeScript code.