{"id":19142246,"url":"https://github.com/eldoy/spekk","last_synced_at":"2025-08-12T06:14:30.031Z","repository":{"id":57367317,"uuid":"369671865","full_name":"eldoy/spekk","owner":"eldoy","description":"Javascript test runner for NodeJS applications.","archived":false,"fork":false,"pushed_at":"2025-05-31T19:58:54.000Z","size":79,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-13T12:07:19.061Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/eldoy.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,"zenodo":null}},"created_at":"2021-05-21T23:02:09.000Z","updated_at":"2025-05-31T19:57:31.000Z","dependencies_parsed_at":"2024-09-12T06:55:40.174Z","dependency_job_id":"332312c1-4544-42e1-a93b-9b2f30594226","html_url":"https://github.com/eldoy/spekk","commit_stats":{"total_commits":34,"total_committers":1,"mean_commits":34.0,"dds":0.0,"last_synced_commit":"a42f81b6df4cba60846ed80d0684fa5884c28f8c"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/eldoy/spekk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Fspekk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Fspekk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Fspekk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Fspekk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eldoy","download_url":"https://codeload.github.com/eldoy/spekk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldoy%2Fspekk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270011192,"owners_count":24511902,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-09T07:26:30.653Z","updated_at":"2025-08-12T06:14:30.003Z","avatar_url":"https://github.com/eldoy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spekk\n\nJavascript test runner for NodeJS applications.\n\n### Install\n\n```\n# Install globally\nnpm i -g spekk\n\n# Install locally in app\nnpm i spekk\n```\n\n### Usage\n\nAdd your tests in `spec/tests`. Data and test helpers can be added in `spec/data` and `spec/lib` respectively, they will be loaded automatically if they exist.\n\nOptionally create a spekk file in `spec/spekk.js`. The `spec/spekk.js` file must export a function that returns a Javascript object with the things you need for your tests:\n\n```js\nmodule.exports = async function() {\n  // Set up db connection for example\n  var db = await db({ name: 'spekk-test' })\n\n  // Run before run if defined\n  async function setup() {}\n\n  // Run after run if defined\n  async function teardown() {}\n\n  return { db, setup, teardown }\n}\n```\n\nWhatever the spekk file returns will be available in the tests:\n\n```js\n// spec/tests/spec-test.js\nit('should test something', async function({ t, db, data, lib }) {\n  var user = await db('user').get()\n  t.ok(user.id)\n})\n```\n\nThe `t` in the function above is included automatically and is [Node assert.](https://nodejs.org/api/assert.html)\n\nThere are some built in global functions you can use in [your tests](https://github.com/eldoy/spekk/blob/master/spec/tests/spekk-test.js):\n\n* `it` or `test`- defines a test which will be run\n* `xit` or `x` - skips a test and does nothing\n* `only` or `o` - only these tests will be run\n* `beforeEach` - run before each test\n* `afterEach` - run after each test\n* `beforeAll` - run before all tests in a file\n* `afterAll` - run after all tests in a file\n\nRun the tests with:\n```\nspekk\n```\nThe name of the test will be taken from the file name, so if your test file is named `project-test.js`, then the test name will be `Project Test`.\n\nThis is a full example, stored in `spec/tests/spekk-test.js`:\n```js\n// Setup is run before each test\nbeforeEach(async function({ t }){\n  // Do something before each test\n})\n\n// This test is being run\nit('should test it', async ({ t }) =\u003e {\n  t.ok(true)\n})\n\n// This test is skipped\nxit('should test it', async ({ t }) =\u003e {\n  t.ok(true)\n})\n\n// Only this test will be run\nonly('should test it', async ({ t }) =\u003e {\n  t.ok(true)\n})\n```\n\nTo run only certain tests, you can match with a regex pattern:\n```\n# Match any test file name that includes 'pattern'\nspekk pattern\n\n# Multiple patterns file, comma separated\nspekk todo,project\n```\n\nIf you want automatically run the tests when you save a file you can use [nodemon:](https://github.com/remy/nodemon)\n\n```\nnodemon --exec spekk\n```\n\nAdd this to you `package.json` file to run with `npm`:\n```json\n\"scripts\": {\n  \"test\": \"nodemon -q --exec spekk\"\n}\n```\nThen run with `npm run test` in your application.\n\nMIT Licensed. Enjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldoy%2Fspekk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldoy%2Fspekk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldoy%2Fspekk/lists"}