{"id":18698451,"url":"https://github.com/plurid/runner","last_synced_at":"2026-04-18T02:32:41.487Z","repository":{"id":57137335,"uuid":"314489733","full_name":"plurid/runner","owner":"plurid","description":"Test Runner with Preparation/Postparation Stages","archived":false,"fork":false,"pushed_at":"2023-04-25T20:38:35.000Z","size":1820,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-02T03:11:38.157Z","etag":null,"topics":["javascript","testing","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/plurid.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":"2020-11-20T08:20:14.000Z","updated_at":"2022-09-28T10:52:23.000Z","dependencies_parsed_at":"2024-11-11T16:01:11.730Z","dependency_job_id":null,"html_url":"https://github.com/plurid/runner","commit_stats":{"total_commits":79,"total_committers":1,"mean_commits":79.0,"dds":0.0,"last_synced_commit":"8949c483c8dc8c7dd809015204a760a6892e0e00"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/plurid/runner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plurid%2Frunner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plurid%2Frunner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plurid%2Frunner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plurid%2Frunner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plurid","download_url":"https://codeload.github.com/plurid/runner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plurid%2Frunner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31953782,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":["javascript","testing","typescript"],"created_at":"2024-11-07T11:28:22.877Z","updated_at":"2026-04-18T02:32:41.466Z","avatar_url":"https://github.com/plurid.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/plurid/runner/master/about/identity/runner-logo.png\" height=\"250px\"\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca target=\"_blank\" href=\"https://github.com/plurid/runner/blob/master/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/license-DEL-blue.svg?colorB=1380C3\u0026style=for-the-badge\" alt=\"License: DEL\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\n\n\u003ch1 align=\"center\"\u003e\n    runner\n\u003c/h1\u003e\n\n\n\u003ch3 align=\"center\"\u003e\n    Test Runner\n\u003c/h3\u003e\n\n\n\n`runner` is intended to run programmatic tests with complete preparation and postparation stages.\n\nSupported languages:\n\n+ `JavaScript`\n+ `TypeScript`\n\n\n### Contents\n\n+ [Usage](#usage)\n+ [Packages](#packages)\n\n\n\n## Usage\n\nInstall `runner`\n\n```\nnpm install --save-dev @plurid/runner\n```\n\nor\n\n```\nyarn add -D @plurid/runner\n```\n\nwrite a test `runner` using `TypeScript` or `JavaScript`, adding `.run`, `.test`, or `.runner` before the file extension (e.g. `example.run.ts`)\n\n``` typescript\nimport runner, {\n    RunnerPrepare,\n    RunnerPostpare,\n    RunnerRun,\n} from '@plurid/runner';\n\n\n\ninterface Prepared {\n    data: boolean;\n}\ninterface Runned {\n    data: boolean;\n}\n\n\nconst prepare: RunnerPrepare\u003cPrepared\u003e = async (\n    check,\n) =\u003e {\n    const value = Math.random();\n    check('example · works', value, 0.5, '\u003c');\n\n    const data = value \u003c 0.5;\n    check('example · works', data, true);\n\n    return {\n        data,\n    };\n}\n\nconst run: RunnerRun\u003cPrepared, Runned\u003e = async (\n    check,\n    prepared,\n) =\u003e {\n    check('example · works', prepared.data, true);\n\n    return {\n        data: false,\n    };\n}\n\nconst postpare: RunnerPostpare\u003cPrepared, Runned\u003e = async (\n    check,\n    prepared,\n    runned,\n) =\u003e {\n    check('example · works', prepared.data, true);\n    const passed = check('example · works', runned.data, true);\n\n    if (passed) {\n        // passed action\n    } else {\n        // not passed action\n    }\n}\n\n\nrunner(\n    prepare,\n    run,\n    postpare,\n);\n```\n\nTo execute the runners use the `runner` cli\n\n``` bash\nrunner /path/to/test/file/or/folder\n```\n\nRunning the example `runner` will log similar to the following\n\n``` bash\nprepare passed :: example · works :: 0.15412422456759045 \u003c 0.5\nprepare passed :: example · works :: true == true\nrun passed :: example · works :: true == true\npostpare passed :: example · works :: true == true\npostpare failed :: example · works :: false not == true\n\nor\n\nprepare failed :: example · works :: 0.7123851592649375 not \u003c 0.5\nprepare failed :: example · works :: false not == true\nrun failed :: example · works :: false not == true\npostpare failed :: example · works :: false not == true\npostpare failed :: example · works :: false not == true\n```\n\nThe `prepare` and `postpare` are meant for setting up and tearing down the environment in which the `run` will execute.\n\nThe results of `prepare` are passed to `run`, and the results of `prepare` and `run` are passed to `postpare`.\n\nUsually, `prepare` and `postpare` imply priviledged executions (such as writing/deleting directly from the database, direct manipulation of the file system, anything required to ensure the `run` is set to pass).\n\n`check`s can be performed at any stage of the `runner`.\n\nA `check` respects the following interface\n\n``` typescript\nexport type Check = (\n    message: string,\n    testValue: any,\n    expectedValue: any,\n    relationship?: CheckRelationship,\n) =\u003e void;\n\nexport type CheckRelationship =\n    | '==' | '\u003c' | '\u003c=' | '\u003e' | '\u003e=';\n```\n\n\n\n## Packages\n\n\u003ca target=\"_blank\" href=\"https://www.npmjs.com/package/@plurid/runner\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/@plurid/runner.svg?logo=npm\u0026colorB=1380C3\u0026style=for-the-badge\" alt=\"Version\"\u003e\n\u003c/a\u003e\n\n[@plurid/runner-javascript][runner-javascript] • the `JavaScript`/`TypeScript` implementation\n\n[runner-javascript]: https://github.com/plurid/runner/tree/master/packages/runner-javascript\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplurid%2Frunner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplurid%2Frunner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplurid%2Frunner/lists"}