ApiTests is a package for the Datagrok platform.
To add tests for Datagrok's JS API:
-
Create a folder under
src/
for your test files (each file typically includes tests for one category) -
Get the package dependencies (
npm install
) -
Import the required utilities (refer to other tests as an example):
import { category, expect, test } from '@datagrok-libraries/utils/src/test';
-
Write some tests
-
Import your test files in
src/package-test.ts
-
Publish the package
-
Open Datagrok and start the console (
~
orWindows | Console
) -
Launch tests for a category via
ApiTests:test(category="category-name")
, e.g.,ApiTests:test(category="Layouts")
, or a specific test viaApiTests:test(category="category-name", test="test-name")
, e.g.,ApiTests:test(category="Layouts", test="ViewLayout.toJson()")
, and wait for the results