{"id":18020932,"url":"https://github.com/edubart/lester","last_synced_at":"2025-03-26T22:30:31.089Z","repository":{"id":139039858,"uuid":"338930871","full_name":"edubart/lester","owner":"edubart","description":"Minimal Lua test framework","archived":false,"fork":false,"pushed_at":"2023-10-18T11:18:01.000Z","size":78,"stargazers_count":26,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-22T14:22:09.178Z","etag":null,"topics":["busted","lua","nelua","test","test-framework","testing","unit-testing"],"latest_commit_sha":null,"homepage":"https://edubart.github.io/lester/","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edubart.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-15T00:20:17.000Z","updated_at":"2024-12-18T22:25:05.000Z","dependencies_parsed_at":"2023-05-03T10:23:00.092Z","dependency_job_id":"47ea0b59-3e32-4580-ada3-538c7ccc819d","html_url":"https://github.com/edubart/lester","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edubart%2Flester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edubart%2Flester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edubart%2Flester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edubart%2Flester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edubart","download_url":"https://codeload.github.com/edubart/lester/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245747385,"owners_count":20665779,"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":["busted","lua","nelua","test","test-framework","testing","unit-testing"],"created_at":"2024-10-30T06:08:19.087Z","updated_at":"2025-03-26T22:30:30.739Z","avatar_url":"https://github.com/edubart.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lester\n\nMinimal Lua test framework.\n\nLester is a minimal unit testing framework for Lua with a focus on being simple to use.\n\nIt is highly inspired by\n[Busted](http://olivinelabs.com/busted/) and [Lust](https://github.com/bjornbytes/lust).\nIt was mainly created to replace Busted without dependencies in the\n[Nelua](https://github.com/edubart/nelua-lang) compiler.\n\n[![asciicast](https://asciinema.org/a/GihfI07vCt9Q7cvL6xCtnoNl1.svg)](https://asciinema.org/a/GihfI07vCt9Q7cvL6xCtnoNl1)\n\n## Features\n\n* Minimal, just one file.\n* Self contained, no external dependencies.\n* Simple and hackable when needed.\n* Use `describe` and `it` blocks to describe tests.\n* Supports `before` and `after` handlers.\n* Supports marking tests as disabled to be skipped.\n* Colored output.\n* Configurable via the script or with environment variables.\n* Quiet mode, to use in live development.\n* Optionally filter tests by name.\n* Show traceback on errors.\n* Show time to complete tests.\n* Works with Lua 5.1+.\n* Efficient.\n\n## Usage\n\nCopy `lester.lua` file to a project and require it,\nwhich returns a table that includes all of the functionality:\n\n```lua\nlocal lester = require 'lester'\nlocal describe, it, expect = lester.describe, lester.it, lester.expect\n\n-- Customize lester configuration.\nlester.show_traceback = false\n\ndescribe('my project', function()\n  lester.before(function()\n    -- This function is run before every test.\n  end)\n\n  describe('module1', function() -- Describe blocks can be nested.\n    it('feature1', function()\n      expect.equal('something', 'something') -- Pass.\n    end)\n\n    it('feature2', function()\n      expect.truthy(false) -- Fail.\n    end)\n\n    local feature3_test_enabled = false\n    it('feature3', function() -- This test will be skipped.\n      expect.truthy(false) -- Fail.\n    end, feature3_test_enabled)\n  end)\nend)\n\nlester.report() -- Print overall statistic of the tests run.\nlester.exit() -- Exit with success if all tests passed.\n```\n\n## Customizing output with environment variables\n\nTo customize the output of lester externally,\nyou can set the following environment variables before running a test suite:\n\n* `LESTER_QUIET=\"true\"`, omit print of passed tests.\n* `LESTER_COLORED=\"false\"`, disable colored output.\n* `LESTER_SHOW_TRACEBACK=\"false\"`, disable traceback on test failures.\n* `LESTER_SHOW_ERROR=\"false\"`, omit print of error description of failed tests.\n* `LESTER_STOP_ON_FAIL=\"true\"`, stop on first test failure.\n* `LESTER_UTF8TERM=\"false\"`, disable printing of UTF-8 characters.\n* `LESTER_FILTER=\"some text\"`, filter the tests that should be run.\n\nNote that these configurations can be changed via script too, check the documentation.\n\n## Customizing output with command line arguments\n\nYou can also customize output using command line arguments\nif `lester.parse_args()` is called at startup.\n\nThe following command line arguments are available:\n\n* `--quiet`, omit print of passed tests.\n* `--no-quiet`, show print of passed tests.\n* `--no-color`, disable colored output.\n* `--no-show-traceback`, disable traceback on test failures.\n* `--no-show-error`, omit print of error description of failed tests.\n* `--stop-on-fail`, stop on first test failure.\n* `--no-utf8term`, disable printing of UTF-8 characters.\n* `--filter=\"some text\"`, filter the tests that should be run.\n\n## Documentation\n\nThe full API reference and documentation can be viewed in the\n[documentation website](https://edubart.github.io/lester/).\n\n## Install\n\nYou can use luarocks to install quickly:\n\n```bash\nluarocks install lester\n```\n\nOr just copy the `lester.lua` file, the library is self contained in this single file with no dependencies.\n\n## Tests\n\nTo check if everything is working as expected under your machine run `lua tests.lua` or `make test`.\n\n## License\n\nMIT, see LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedubart%2Flester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedubart%2Flester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedubart%2Flester/lists"}