mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-29 08:14:57 +00:00
- Added `jsonScript` property to metadata schema for JSON script entry points. - Refactored `generate-package.ts` to replace Lua scripts with JSON scripts for lifecycle hooks. - Updated test generation to use JSON format for metadata validation. - Modified documentation and comments to reflect the transition from Lua to JSON scripting. - Adjusted Storybook configuration and mock data to align with new JSON script structure. - Renamed relevant files and references from Lua to JSON for consistency across the project.
205 lines
4.9 KiB
JSON
205 lines
4.9 KiB
JSON
{
|
|
"$schema": "https://metabuilder.dev/schemas/json-script.schema.json",
|
|
"schemaVersion": "2.2.0",
|
|
"package": "testing",
|
|
"description": "JSON-based testing framework functions including assertions, mocks, and test runner",
|
|
"functions": [
|
|
{
|
|
"id": "framework_load_cases",
|
|
"name": "loadCases",
|
|
"exported": true,
|
|
"description": "Load test cases from JSON content",
|
|
"category": "core"
|
|
},
|
|
{
|
|
"id": "framework_create_suite",
|
|
"name": "createSuite",
|
|
"exported": true,
|
|
"description": "Create a new test suite",
|
|
"category": "core"
|
|
},
|
|
{
|
|
"id": "describe_it",
|
|
"name": "describe",
|
|
"exported": true,
|
|
"description": "BDD-style describe block for grouping tests",
|
|
"category": "core"
|
|
},
|
|
{
|
|
"id": "describe_it_case",
|
|
"name": "it",
|
|
"exported": true,
|
|
"description": "BDD-style it block for individual test cases",
|
|
"category": "core"
|
|
},
|
|
{
|
|
"id": "assertions_expect",
|
|
"name": "expect",
|
|
"exported": true,
|
|
"description": "Chainable assertion builder",
|
|
"category": "assertions"
|
|
},
|
|
{
|
|
"id": "assertions_true",
|
|
"name": "assertTrue",
|
|
"exported": true,
|
|
"description": "Assert value is truthy",
|
|
"category": "assertions"
|
|
},
|
|
{
|
|
"id": "assertions_false",
|
|
"name": "assertFalse",
|
|
"exported": true,
|
|
"description": "Assert value is falsy",
|
|
"category": "assertions"
|
|
},
|
|
{
|
|
"id": "assertions_equal",
|
|
"name": "assertEqual",
|
|
"exported": true,
|
|
"description": "Assert two values are equal",
|
|
"category": "assertions"
|
|
},
|
|
{
|
|
"id": "assertions_not_equal",
|
|
"name": "assertNotEqual",
|
|
"exported": true,
|
|
"description": "Assert two values are not equal",
|
|
"category": "assertions"
|
|
},
|
|
{
|
|
"id": "assertions_nil",
|
|
"name": "assertNil",
|
|
"exported": true,
|
|
"description": "Assert value is nil",
|
|
"category": "assertions"
|
|
},
|
|
{
|
|
"id": "assertions_not_nil",
|
|
"name": "assertNotNil",
|
|
"exported": true,
|
|
"description": "Assert value is not nil",
|
|
"category": "assertions"
|
|
},
|
|
{
|
|
"id": "mocks_fn",
|
|
"name": "fn",
|
|
"exported": true,
|
|
"description": "Create a mock function",
|
|
"category": "mocks"
|
|
},
|
|
{
|
|
"id": "mocks_spy_on",
|
|
"name": "spyOn",
|
|
"exported": true,
|
|
"description": "Spy on an object method",
|
|
"category": "mocks"
|
|
},
|
|
{
|
|
"id": "mocks_mock_object",
|
|
"name": "mockObject",
|
|
"exported": true,
|
|
"description": "Create a mock object",
|
|
"category": "mocks"
|
|
},
|
|
{
|
|
"id": "mocks_fake_timers",
|
|
"name": "useFakeTimers",
|
|
"exported": true,
|
|
"description": "Mock timer functions for testing async code",
|
|
"category": "mocks"
|
|
},
|
|
{
|
|
"id": "runner_run_test",
|
|
"name": "runTest",
|
|
"exported": true,
|
|
"description": "Run a single test",
|
|
"category": "runner"
|
|
},
|
|
{
|
|
"id": "runner_run_suite",
|
|
"name": "runSuite",
|
|
"exported": true,
|
|
"description": "Run all tests in a suite",
|
|
"category": "runner"
|
|
},
|
|
{
|
|
"id": "runner_run_all",
|
|
"name": "runAll",
|
|
"exported": true,
|
|
"description": "Run all registered test suites",
|
|
"category": "runner"
|
|
},
|
|
{
|
|
"id": "runner_format_report",
|
|
"name": "formatReport",
|
|
"exported": true,
|
|
"description": "Format test results as human-readable report",
|
|
"category": "runner"
|
|
},
|
|
{
|
|
"id": "runner_format_json",
|
|
"name": "formatJSON",
|
|
"exported": true,
|
|
"description": "Format test results as JSON",
|
|
"category": "runner"
|
|
},
|
|
{
|
|
"id": "hooks_before_all",
|
|
"name": "beforeAll",
|
|
"exported": true,
|
|
"description": "Run setup before all tests in suite",
|
|
"category": "hooks"
|
|
},
|
|
{
|
|
"id": "hooks_after_all",
|
|
"name": "afterAll",
|
|
"exported": true,
|
|
"description": "Run teardown after all tests in suite",
|
|
"category": "hooks"
|
|
},
|
|
{
|
|
"id": "hooks_before_each",
|
|
"name": "beforeEach",
|
|
"exported": true,
|
|
"description": "Run setup before each test",
|
|
"category": "hooks"
|
|
},
|
|
{
|
|
"id": "hooks_after_each",
|
|
"name": "afterEach",
|
|
"exported": true,
|
|
"description": "Run teardown after each test",
|
|
"category": "hooks"
|
|
}
|
|
],
|
|
"exports": {
|
|
"functions": [
|
|
"loadCases",
|
|
"createSuite",
|
|
"describe",
|
|
"it",
|
|
"expect",
|
|
"assertTrue",
|
|
"assertFalse",
|
|
"assertEqual",
|
|
"assertNotEqual",
|
|
"assertNil",
|
|
"assertNotNil",
|
|
"fn",
|
|
"spyOn",
|
|
"mockObject",
|
|
"useFakeTimers",
|
|
"runTest",
|
|
"runSuite",
|
|
"runAll",
|
|
"formatReport",
|
|
"formatJSON",
|
|
"beforeAll",
|
|
"afterAll",
|
|
"beforeEach",
|
|
"afterEach"
|
|
]
|
|
}
|
|
}
|