From the panel or the terminal
The Test Cases page runs a test case and shows every test as the server reports it. npm run test runs them all, or the ones you name, from the folder of the local client: for you, or for your AI assistant.
API Maker
The backend engine for the AI era
Team & delivery
Test the business logic of your custom APIs and utility classes, inside API Maker.
A test case is a file of small tests, in TypeScript or in any other language API Maker runs, with the assertions of that language. Mocks stand in for the database and system APIs, so a test checks your logic without touching real data. Run them from the panel or from your terminal, and see each result with the line that failed and the lines that ran.
Step through it, slow it down, or open the full canvas.
Test cases live next to your code. A test case is a file of small tests, in any of the 8 languages. In TypeScript, as here: an array of tests, each with a name and an async function using node:assert. Import your utility classes and call them with g.
A test case is a file of small tests, in any of the 8 languages. In TypeScript, as here: an array of tests, each with a name and an async function using node:assert. Import your utility classes and call them with g.
Pick an API method, here g.sys.db.query, the values its arguments must have and what it returns. A matching call gets that value, no database needed.
Each test calls your real code. The query is answered by the mock, the database is not called, and every assert is checked.
Execute runs every test of the test case you are on. Run lets you check the test cases you want. Each small test shows its own result.
Someone moves the discount threshold. The failing test shows the assert message and its line in your code, before anything is deployed.
The Test Cases page runs a test case and shows every test as the server reports it. npm run test runs them all, or the ones you name, from the folder of the local client: for you, or for your AI assistant.
Test cases go to Git with the rest of the project, so a pull request shows the tests next to the change.
Every run reports which lines of your custom APIs, utility classes and test cases ran, on the page and as an lcov file for VS Code and WebStorm.
Someone changes the discount threshold in a utility class. The test case fails with its message and line, before the change reaches a pull request.
import * as T from 'types';import * as assert from 'node:assert';import * as pricing from 'utils/Pricing';module.exports = [ { name: 'No discount under 1000', code: async (g: T.IAMGlobal) => { assert.strictEqual(await pricing.discountFor(g, 999), 0); }, }, { name: '10% from 1000', code: async (g: T.IAMGlobal) => { assert.strictEqual(await pricing.discountFor(g, 1000), 100); }, },];On the real admin panel, with real data.
Length 7:04Test cases in depthMocks That Fail, Count and Compute : Test Cases in 8 Languages and in CI
Length 6:13CoverageCode Coverage of Backend Tests in Eight Languages
Length 5:44API TestingAPI Testing in the Panel: Call, Debug, Export and Share Any API
Length 8:43DebuggingDebug an API from the Failing Call to the Line That BrokeOn the server, in the sandbox of your account for the language of the test case, like your custom APIs. A test can run a custom API written in another language.
Yes, from the API testing page: send a request with any body and headers, read the response, and keep it as a saved state.