KT Testing Suite Core follows the familiar Jest/Mocha pattern of grouping related tests into named suites usingDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Octopodo/kt-testing-suite-core/llms.txt
Use this file to discover all available pages before exploring further.
describe(), and defining individual test cases with it(). This structure keeps your test output readable and lets you share setup logic across related assertions — a natural fit for ExtendScript environments where each test file is compiled and run as a standalone script.
The Suite Object
When you calldescribe(), the library creates a Suite object internally and registers it in a module-level array. Understanding this object helps you reason about how the runner traverses your tests.
| Property | Type | Description |
|---|---|---|
description | string | The human-readable label for this suite, shown in output. |
tests | Test[] | All it() cases registered directly inside this describe. |
children | Suite[] | Nested describe blocks declared inside this suite. |
parent | Suite | Reference to the enclosing suite, or undefined for root suites. |
describe) are pushed into the top-level suites array and returned by getSuites(). Nested suites are attached to their parent’s children array instead, so the runner can walk the full tree in declaration order.
Defining a Suite with describe()
describe() takes a string description and a callback. Every it() call and hook registration inside that callback belongs to the suite.
it() must be called inside a describe() callback. Calling it at module scope throws:
Error: it() must be called inside a describe()Defining Test Cases with it()
it() registers a single test case in the current suite. It accepts a name and a TestFn — a zero-argument function that runs assertions. If the function throws, the test is marked failed; if it returns normally, the test passes.
name string becomes the second segment of the full test name that the runner uses for filtering. For example, a test named 'should add numbers' inside describe('Math operations') has the full name "Math operations should add numbers".
Nesting describe() Blocks
You can nest describe() calls arbitrarily deep to model the hierarchy of the system under test. The runner processes child suites after all the direct tests of their parent suite, and it builds a running currentDescription path by joining parent and child descriptions with a space.
A Complete Test File
A real test file imports the API, declares one or moredescribe blocks, and that’s it. The call to runTests() lives in the entry file, not in individual test files.
The Test Entry File Pattern
Because ExtendScript bundles all source into a single file at compile time, test suites are registered as a side-effect of importing their module. The entry file simply imports every test module (so theirdescribe() calls run and register suites) and then calls runTests() once to execute them all.
Import all test modules
Each import executes the module’s top-level code, which calls
describe() and populates the internal suites array.Retrieving Registered Suites with getSuites()
If you need the suite list yourself — for example to pass it to a custom TestRunner — call getSuites() after all test modules have been imported.
getSuites() returns only the root-level suites. The runner recursively walks each suite’s children array, so nested suites are reached automatically — you never need to flatten the tree yourself.
describe()
Creates a named test suite. Nested calls attach child suites to the parent’s
children array.it()
Registers a single test case in the current suite. Throws if called outside a
describe().getSuites()
Returns all root-level registered suites. Call it after importing all test modules.
runTests()
Convenience wrapper that calls
getSuites() and runs everything through a TestRunner.