You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add programmatic API with getSuites(), executeSuite(), executeTest()
Add clean programmatic API to Codecept class that wraps Mocha internals,
eliminating duplicated boilerplate across dryRun, workers, and custom scripts.
- getSuites(pattern?) returns parsed suites with tests as plain objects
- executeSuite(suite) runs all tests in a suite
- executeTest(test) runs a single test by fullTitle
- Refactor workers.js to use getSuites() (removes ~30 lines of Mocha boilerplate)
- Refactor dryRun.js to use getSuites() (removes Container.mocha() dependency)
- Export Result class from lib/index.js
- Rewrite docs/internal-api.md with full programmatic API reference
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@@ -225,42 +225,143 @@ Step events provide step objects with following fields:
225
225
226
226
Whenever you execute tests with `--verbose` option you will see registered events and promises executed by a recorder.
227
227
228
-
## Custom Runner
228
+
## Programmatic API
229
229
230
-
You can run CodeceptJS tests from your script.
230
+
CodeceptJS can be imported and used programmatically from your scripts. The main entry point is the `Codecept` class, which provides methods to list and execute tests.
0 commit comments