{"id":17921987,"url":"https://github.com/thibaultcha/lua-resty-busted","last_synced_at":"2025-03-24T02:32:09.421Z","repository":{"id":152276783,"uuid":"49710462","full_name":"thibaultcha/lua-resty-busted","owner":"thibaultcha","description":"Test OpenResty scripts with busted","archived":false,"fork":false,"pushed_at":"2023-12-22T02:57:34.000Z","size":4,"stargazers_count":32,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T20:01:52.654Z","etag":null,"topics":["lua-resty","ngx-lua","openresty"],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thibaultcha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-01-15T09:46:59.000Z","updated_at":"2023-12-22T02:52:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"664cf2e3-e1b6-4061-b01b-02eb4d2f1f97","html_url":"https://github.com/thibaultcha/lua-resty-busted","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibaultcha%2Flua-resty-busted","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibaultcha%2Flua-resty-busted/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibaultcha%2Flua-resty-busted/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thibaultcha%2Flua-resty-busted/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thibaultcha","download_url":"https://codeload.github.com/thibaultcha/lua-resty-busted/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245198664,"owners_count":20576410,"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":["lua-resty","ngx-lua","openresty"],"created_at":"2024-10-28T20:37:03.919Z","updated_at":"2025-03-24T02:32:09.132Z","avatar_url":"https://github.com/thibaultcha.png","language":"Lua","funding_links":[],"categories":["Lua"],"sub_categories":[],"readme":"# lua-resty-busted ![Module Version][badge-version-image]\n\nA little hack to test OpenResty scripts with [busted].\n\nBy overriding the `busted` executable with the one shipped with this module, busted runs with the [resty-cli] interpreter, which can execute Lua scripts written for OpenResty from the CLI.\n\n### Install\n\nBy default, the script is installed under `/usr/local/bin`. You can use the Makefile variables (also from Luarocks) to install it somewhere else.\n\nLuarocks:\n```\n$ luarocks install lua-resty-busted\n```\n\nMakefile:\n```\n$ make install\n```\n\nManually: just copy the `bin/busted` script somewhere in your `$PATH`.\n\n### Usage\n\n```lua\ndescribe(\"openresty script\", function()\n  it(\"should run in ngx_lua context\", function()\n    assert.equal(0, ngx.OK)\n    assert.equal(200, ngx.HTTP_OK)\n  end)\n  it(\"should wait\", function()\n    ngx.sleep(3)\n    assert.is_true(1 == 1)\n  end)\nend)\n```\n\nFrom [resty-cli]'s documentation:\n\n\u003e The Lua code is initiated by the init_worker_by_lua directive and run in the context of ngx.timer callback. So all of ngx_lua's Lua APIs available in the ngx.timer callback context are also available in the resty utility. We may remove some of the remaining limitations in the future though.\n\n### License\n\nWork licensed under the MIT License. Please check [Olivine-Labs/busted][busted] for the license of the underlying, actual testing framework, and [OpenResty/lua-resty-cli](https://github.com/openresty/resty-cli) for the license of the interpreter.\n\n[busted]: https://github.com/Olivine-Labs/busted\n[resty-cli]: https://github.com/openresty/resty-cli\n[badge-version-image]: https://img.shields.io/badge/version-0.0.1-blue.svg?style=flat\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthibaultcha%2Flua-resty-busted","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthibaultcha%2Flua-resty-busted","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthibaultcha%2Flua-resty-busted/lists"}