Files
metabuilder/packages/testing/scripts/functions.json
johndoe6345789 ef709d47c0 refactor: update testing framework and restructure test configurations
- Changed devDependencies from "lua_test" to "testing" in package.json for ui_level4, ui_level5, ui_level6, ui_login, ui_pages, ui_permissions, user_manager, and workflow_editor.
- Removed legacy test scripts and parameterized tests, replacing them with a unified test suite structure in the tests section of package.json.
- Introduced new metadata.params.json files for each package to define test parameters for package ID validation, icon file existence, and JSON schema validation.
- Created new metadata.test.json files for each package to define structured test cases for validating package metadata, including checks for package ID, icon file existence, and schema validity.
2026-01-02 21:25:45 +00:00

229 lines
5.7 KiB
JSON

{
"$schema": "https://metabuilder.dev/schemas/json-script.schema.json",
"schemaVersion": "2.2.0",
"package": "lua_test",
"description": "Lua unit 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",
"luaScript": "framework.lua"
},
{
"id": "framework_create_suite",
"name": "createSuite",
"exported": true,
"description": "Create a new test suite",
"category": "core",
"luaScript": "framework.lua"
},
{
"id": "describe_it",
"name": "describe",
"exported": true,
"description": "BDD-style describe block for grouping tests",
"category": "core",
"luaScript": "describe.lua"
},
{
"id": "describe_it_case",
"name": "it",
"exported": true,
"description": "BDD-style it block for individual test cases",
"category": "core",
"luaScript": "describe.lua"
},
{
"id": "assertions_expect",
"name": "expect",
"exported": true,
"description": "Chainable assertion builder",
"category": "assertions",
"luaScript": "assertions.lua"
},
{
"id": "assertions_true",
"name": "assertTrue",
"exported": true,
"description": "Assert value is truthy",
"category": "assertions",
"luaScript": "assertions.lua"
},
{
"id": "assertions_false",
"name": "assertFalse",
"exported": true,
"description": "Assert value is falsy",
"category": "assertions",
"luaScript": "assertions.lua"
},
{
"id": "assertions_equal",
"name": "assertEqual",
"exported": true,
"description": "Assert two values are equal",
"category": "assertions",
"luaScript": "assertions.lua"
},
{
"id": "assertions_not_equal",
"name": "assertNotEqual",
"exported": true,
"description": "Assert two values are not equal",
"category": "assertions",
"luaScript": "assertions.lua"
},
{
"id": "assertions_nil",
"name": "assertNil",
"exported": true,
"description": "Assert value is nil",
"category": "assertions",
"luaScript": "assertions.lua"
},
{
"id": "assertions_not_nil",
"name": "assertNotNil",
"exported": true,
"description": "Assert value is not nil",
"category": "assertions",
"luaScript": "assertions.lua"
},
{
"id": "mocks_fn",
"name": "fn",
"exported": true,
"description": "Create a mock function",
"category": "mocks",
"luaScript": "mocks.lua"
},
{
"id": "mocks_spy_on",
"name": "spyOn",
"exported": true,
"description": "Spy on an object method",
"category": "mocks",
"luaScript": "mocks.lua"
},
{
"id": "mocks_mock_object",
"name": "mockObject",
"exported": true,
"description": "Create a mock object",
"category": "mocks",
"luaScript": "mocks.lua"
},
{
"id": "mocks_fake_timers",
"name": "useFakeTimers",
"exported": true,
"description": "Mock timer functions for testing async code",
"category": "mocks",
"luaScript": "mocks.lua"
},
{
"id": "runner_run_test",
"name": "runTest",
"exported": true,
"description": "Run a single test",
"category": "runner",
"luaScript": "runner.lua"
},
{
"id": "runner_run_suite",
"name": "runSuite",
"exported": true,
"description": "Run all tests in a suite",
"category": "runner",
"luaScript": "runner.lua"
},
{
"id": "runner_run_all",
"name": "runAll",
"exported": true,
"description": "Run all registered test suites",
"category": "runner",
"luaScript": "runner.lua"
},
{
"id": "runner_format_report",
"name": "formatReport",
"exported": true,
"description": "Format test results as human-readable report",
"category": "runner",
"luaScript": "runner.lua"
},
{
"id": "runner_format_json",
"name": "formatJSON",
"exported": true,
"description": "Format test results as JSON",
"category": "runner",
"luaScript": "runner.lua"
},
{
"id": "hooks_before_all",
"name": "beforeAll",
"exported": true,
"description": "Run setup before all tests in suite",
"category": "hooks",
"luaScript": "hooks.lua"
},
{
"id": "hooks_after_all",
"name": "afterAll",
"exported": true,
"description": "Run teardown after all tests in suite",
"category": "hooks",
"luaScript": "hooks.lua"
},
{
"id": "hooks_before_each",
"name": "beforeEach",
"exported": true,
"description": "Run setup before each test",
"category": "hooks",
"luaScript": "hooks.lua"
},
{
"id": "hooks_after_each",
"name": "afterEach",
"exported": true,
"description": "Run teardown after each test",
"category": "hooks",
"luaScript": "hooks.lua"
}
],
"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"
]
}
}