{"id":15297285,"url":"https://github.com/sengitu/kavun","last_synced_at":"2025-04-13T23:09:05.272Z","repository":{"id":57288693,"uuid":"127894087","full_name":"SengitU/kavun","owner":"SengitU","description":" Kavun is a light weight spec runner library for Javascript.","archived":false,"fork":false,"pushed_at":"2022-05-30T18:35:10.000Z","size":496,"stargazers_count":6,"open_issues_count":4,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-01T19:16:21.748Z","etag":null,"topics":["javascript","test","test-driven-development","unit-testing-framework"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/SengitU.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-03T10:53:39.000Z","updated_at":"2022-05-30T18:35:13.000Z","dependencies_parsed_at":"2022-09-20T04:52:10.523Z","dependency_job_id":null,"html_url":"https://github.com/SengitU/kavun","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SengitU%2Fkavun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SengitU%2Fkavun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SengitU%2Fkavun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SengitU%2Fkavun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SengitU","download_url":"https://codeload.github.com/SengitU/kavun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219845375,"owners_count":16556447,"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":["javascript","test","test-driven-development","unit-testing-framework"],"created_at":"2024-09-30T19:16:22.960Z","updated_at":"2024-10-15T03:21:16.615Z","avatar_url":"https://github.com/SengitU.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kavun\n\n[![Build Status](https://travis-ci.org/SengitU/kavun.svg?branch=master)](https://travis-ci.org/sengitu/kavun)\n\nKavun is a lightweight spec runner library for Javascript. See the [ADRs][adrs] and [tenets](#tenets) below for understanding what drives and steers this project.\n\n[adrs]: ./docs/adr\n\n## The Real Kavun\n\nThe project is named after my elder cat Kavun.\n\n![](kavun_tiny.png)\n\n## Installation\n\n`npm install kavun`\n\n### Usage Examples\n\n* Run the tests just for one file do  \n  `kavun test-files.spec.js`\n* or multiple files   \n  `kavun test1.spec.js 2.spec.js test/3.spec.js`\n* or for all `.js` files (use you command line's file grep features, e.g. `*` or `**` etc.)  \n  `kavun *.js`\n* for all files found in root and up to 2 sub-directories, ending in `.js`  \n  `kavun {,**,**/**}/*.js`\n* and mix any of the above  \n  `kavun test-files.spec.js {,**,**/**}/*.js`\n\nKavun does not contain any file-grep functionality. Use your command line's \ngrep and/or file finding features. This was done to remove kavun's complexity.\n\n### Parameters\n\nThe command line takes:\n1) any number of files (no directories!) to run as parameters\n1) `--reporter` which might be `console` or `minimal`\n\n### Unit\n\nA sync example for unit\n\n```js\nimport assert from 'assert';\nimport { it } from 'kavun';\n\nit('Example `it`', () =\u003e {\n  const expected = 2;\n  const actual = 2;\n  assert.equal(actual, expected);\n});\n```\n\nAn async example with async/await\n\n```js\nimport assert from 'assert';\nimport { it } from 'kavun';\n\nit('Example async `it` with async / await', async () =\u003e {\n  const actual = () =\u003e new Promise(resolve =\u003e resolve(true));\n  const expected = true;\n  const result = await actual();\n  \n  assert.equal(expected, result);\n});\n```\n\nAn async example with Promise, don't forget to return the `promise`\n\n```js\nimport assert from 'assert';\nimport { it } from 'kavun';\n\nit('Example async `it` with async / await', () =\u003e {\n  const actual = () =\u003e new Promise(resolve =\u003e resolve(true));\n  const expected = true;\n  \n  return actual().then(result =\u003e assert.equal(expected, result));\n});\n```\n\n### Timeout\n\nTimeout for each spec is 1500 miliseconds by default. To increase this amount, timeout attribute inside of the options object should be provided to the `unit`, as shown in the example;\n\n```js\nit('Example `it` with extended timeout', async () =\u003e {\n  const actual = () =\u003e new Promise(resolve =\u003e setTimeout(() =\u003e resolve(true), 1700));\n  const expected = true;\n\n  const result = await actual();\n  assert.equal(expected, result);\n}, { timeout: 2000 });\n```\n\n### Spec\n\n```js\nimport assert from 'assert';\nimport { describe, it } from 'kavun';\n\ndescribe('Example Spec', () =\u003e {\n  it('unit', () =\u003e {\n    const expected = 2;\n    const actual = 2;\n    assert.equal(actual, expected);\n  });\n\n  describe('Async', () =\u003e {\n    it('with async / await', async () =\u003e {\n      const actual = () =\u003e new Promise(resolve =\u003e resolve(true));\n      const expected = true;\n\n      const result = await actual();\n\n      assert.equal(expected, result)\n    });\n  });\n});\n\n```\n## Tenets\n1) In doubt solve it without a new dependency.\n2) In doubt don't add a new feature, rather remove one.\n3) Prefer speed.\n4) Be compatible to mocha-style test libs, allowing well written tests overrules.\n\n## Development\n\nThe following describes how to (help) develop this code.\n\n## Setup and run\n\nProject requires NodeJS to be installed.\n\n- `cd \u003chere\u003e`\n- (if you want a reproducable env using nix) run `nix-shell`\n- `npm i` to install\n- `npm test` to run all the tests\n- develop ...\n\n## Install/setup, via nix\n\nThe project can be built and run locally using nix, to reproduce the environment.\n1) Make sure to have nix installed (see [nixos.org/nix][nix]) and then\n1) `cd \u003cproject-dir\u003e`\n1) run `nix-shell` and you should have the environment up and running\n1) install all node modules using `npm install`\n1) prove that it works, `npm test`\n1) now you have a shell with a deterministic environment (incl. node version)\n\n[nix]: http://nixos.org/nix/\n\n## Releasing\n\nYou want to know if you are ready to release a new version. \nRun `npm run releasable --silent`, this starts a script that checks the [CHANGELOG.md](./CHANGELOG.md), which\nis your to-do list! What, to-do list? Yes. See below how and why?\n\nTo release a new version run `npm run release` (not `npm version`!), this will include the\nchecks described and do the release and versioning (read more below).\n\n## Recommended Development Process\n\nThis project uses the [to-do-list-checker][1].\nThe development process is also described there and will be followed in this project too.\n\n[1]: https://github.com/wolframkriesing/to-do-list-checker\n[2]: https://github.com/wolframkriesing/to-do-list-checker#recommended-development-process","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsengitu%2Fkavun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsengitu%2Fkavun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsengitu%2Fkavun/lists"}