Skip to main content


DeviceScript provides a unit test framework that runs on the device. It has a syntax similar to Jest/Mocha/Chai.


Configure your project for testing using this command

devs add test

Defining tests

The test framework provides the popular BDD test contructs: describe, test, expect.

import { describe, test, expect } from "@devicescript/test"

describe("this is a test suite", () => {
test("this is a test", () => {

Running tests

From a terminal, run the test DeviceScript

npm run test

See also