Skip to content

Assert

Assert object is used in unit tests.

  • Module: test/assert
  • Definition: N/A
  • Source: /test/assert.js
  • Status: stable
  • Group: core

Basic Usage

import { base64 } from "sdk/utils";
import { assert } from "sdk/test";

const input = "test"
const result = base64.encode(input);

assert.assertEquals(result, 'dGVzdA==', "check if match");

Functions


Function Description Returns
assertTrue(condition, message) Assert as true -
assertFalse(condition, message) Assert as false -
assertNull(object, message) Assert if object is null -
assertNotNull(object, message) Assert if object is not null -
assertEquals(actual, expected, message) Assert if actual object is the same as the expected one -