| sidebar_position | 9.5 |
|---|---|
| description | DeviceScript provides a unit test framework that runs on the device. It has a syntax similar to Jest/Mocha/Chai. |
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 testThe 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", () => {
expect(1).toBe(1)
})
})From a terminal, run the test DeviceScript
npm run test