Unit-Test Export Frameworks Across UI, REST, and MCP
· 2 min read
We added a dedicated Code (Unit Test) export capability that now works consistently across the UI, REST API, and MCP tool interfaces.
Generated output is data-driven (parameterized) test code, with shared options for suite naming, setup scaffolding, pretty print, and data source strategy.
Code vs Code (Unit Test)
Codeexport outputs plain data structures in a programming language (for example arrays/objects/maps) that you can use anywhere in application code.Code (Unit Test)export outputs parameterized test scaffolding for a specific unit test framework, including test-case feeding and assertion skeletons.
In short: Code is data-as-code; Code (Unit Test) is test-scaffold-as-code.
What Is Included
Supported frameworks:
- Java:
junit4,junit5,junit6,testng - Python:
pytest,unittest,nose2 - JavaScript:
jest,vitest,mocha - C#:
xunit,nunit,mstest - Ruby:
rspec,minitest - PHP:
phpunit,pest - Kotlin:
kotest,junit5-kotlin,spek - Perl:
test-more,test2-suite
Interfaces
The same output formats are available in:
- Web UI:
Code (Unit Test)tab with language-specific framework options - REST: existing
/v1/generateand/v1/generate/fromschemaendpoints viaoutputFormat - MCP: existing generation tool format enum/options
Example: Generated Vitest Unit Test
import { describe, expect, it } from 'vitest';
const rows = [
{ Name: 'Connie', Age: 21 },
{ Name: 'Miles', Age: 34 },
];
describe('GeneratedDataTests', () => {
it.each(rows)('row_parameterized_%#', (row) => {
const actual = mapRowUnderTest(row);
expect(actual['Name']).toStrictEqual(row['Name']);
expect(actual['Age']).toStrictEqual(row['Age']);
});
});
function mapRowUnderTest(input: Record<string, unknown>) {
// Replace with your SUT call, e.g. return userMapper.normalize(input);
return input;
}
Docs
The detailed option behavior and framework mapping are documented here:
Official Framework References
- JUnit 4: junit.org/junit4
- JUnit 5 (Jupiter): junit.org/junit5
- JUnit 6: docs.junit.org/6.0.3
- TestNG: testng.org
- pytest: docs.pytest.org
- unittest: docs.python.org unittest
- nose2: docs.nose2.io
- Jest: jestjs.io
- Vitest: vitest.dev
- Mocha: mochajs.org
- xUnit.net: xunit.net
- NUnit: nunit.org
- MSTest: Microsoft MSTest docs
- RSpec: rspec.info
- Minitest: github.com/minitest/minitest
- PHPUnit: phpunit.de
- Pest: pestphp.com
- Kotest: kotest.io
- JUnit 5 Kotlin: junit.org/junit5
- Spek: spekframework.github.io
- Test::More: metacpan.org/pod/Test::More
- Test2::Suite: metacpan.org/pod/Test2::Suite
