Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
43 lines (29 loc) · 821 Bytes

File metadata and controls

43 lines (29 loc) · 821 Bytes
Copy raw file
Download raw file
Outline
Edit and raw actions
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.

Testing

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

Setup

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", () => {
        expect(1).toBe(1)
    })
})

Running tests

From a terminal, run the test DeviceScript

npm run test

See also

Morty Proxy This is a proxified and sanitized view of the page, visit original site.