{"id":23540966,"url":"https://github.com/w13b3/probo","last_synced_at":"2025-06-21T08:34:08.961Z","repository":{"id":37489317,"uuid":"505533541","full_name":"w13b3/Probo","owner":"w13b3","description":"Lua unit test framework","archived":false,"fork":false,"pushed_at":"2022-06-26T08:36:31.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-15T04:34:47.873Z","etag":null,"topics":["documentation","framework","lua","mocking","testing","unit-testing","unittesting-library"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/w13b3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-20T17:19:43.000Z","updated_at":"2022-06-24T15:53:45.000Z","dependencies_parsed_at":"2022-09-15T07:22:44.150Z","dependency_job_id":null,"html_url":"https://github.com/w13b3/Probo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/w13b3/Probo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w13b3%2FProbo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w13b3%2FProbo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w13b3%2FProbo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w13b3%2FProbo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/w13b3","download_url":"https://codeload.github.com/w13b3/Probo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/w13b3%2FProbo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261093074,"owners_count":23108587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["documentation","framework","lua","mocking","testing","unit-testing","unittesting-library"],"created_at":"2024-12-26T05:13:18.641Z","updated_at":"2025-06-21T08:34:03.933Z","avatar_url":"https://github.com/w13b3.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Probo  \u003csub\u003e\u003csup\u003e_Lua unit test framework_\u003csup\u003e\u003csub\u003e\n\nCompatible with [Lua 5.4]\n\n## Test suite example\n```Lua\nlocal Suite = require(\"probo/suite\")\n\nlocal runInfo = {}  -- define a `runInfo` table before the do-end scope\ndo\n    -- create a new test suite instance\n    -- with \u003cclose\u003e defined a garbage-collection cycle is performed at the end this scope\n    local test \u003cclose\u003e = Suite.New(\"Probo Suite example\")\n    local assert \u003cconst\u003e = test -- more readable separation between tests and asserts\n\n    test.run = 1                        -- test suite variable\n\n    function test.AlwaysPasses()        -- this is a defined test\n        assert:Invokable(test)          -- multiple different asserts are available\n    end\n\n    test(\"Always Fails\")                -- test is a decorator\n    (function()                         -- with the decorator test names can have spaces\n        assert:Fail()\n    end)\n\n    function test.FlakyTest()           -- failed tests in the first run can be rerun\n        test.run = test.run + 1         -- if the option `rerunFailedTests` is set to true\n        assert:Condition(test.run \u003e 2)\n    end\n\n    local suiteOptions = {              -- a table with options\n        stopOnFail       = false,       -- stops on first failed test\n        silent           = false,       -- no output\n        rerunFailedTests = true,        -- rerun failed tests\n        sortedByName     = false        -- sort tests by name before the test run\n    }\n\n    -- run the above defined tests with the given options\n    runInfo = test:Run(suiteOptions)    -- runInfo, a table with info about the run\nend\n```\n\n## Create report\nAfter a run a report can be made with the `runInfo` created by the run\n\n```lua\nlocal Report = require(\"probo/htmlreport\")\n\nlocal htmlReport = Report.Create(runInfo)  -- create a HTML report\n\n-- save the report\nlocal reportFile = io.open(\"probo_report.html\", \"w\")\nreportFile:write(htmlReport)\nreportFile:close()\n```\n\n## Mock global functions\nBy mocking it is possible to temporarily change the behaviour of functions.\n\n```lua\nlocal Suite = require(\"probo/suite\")\nlocal Mock = require(\"probo/mock\")\n\ndo\n    local test \u003cclose\u003e = Suite.New(\"Probo Mock example\")\n    local assert \u003cconst\u003e = test\n    local mock \u003cclose\u003e = Mock.New()\n    \n    mock(\"string.reverse\", function(str) return str end)\n    \n    test(\"global string.reverse function is mocked\")\n    (function()\n        local given = \"not reversed\"\n        local actual = string.reverse(given)\n        assert:Equal(given, actual)\n    end)\nend\n\n```\n\n## Unit tests\nCheck out the [unit tests] that test the [Probo] unit test package.\n\n\n## License\n[Apache 2.0]\n\n\n[Lua 5.4]: https://www.lua.org/manual/5.4/ \"Lua 5.4 Manual\"\n[unit tests]: ./test/README.md \"/test/README.md\"\n[Probo]: ./probo/suite.lua \"Lua unit test framework\"\n[Apache 2.0]: ./LICENSE \"LICENSE\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw13b3%2Fprobo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fw13b3%2Fprobo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fw13b3%2Fprobo/lists"}