{"id":16371272,"url":"https://github.com/unional/fixture","last_synced_at":"2026-03-11T13:41:25.933Z","repository":{"id":29933787,"uuid":"123261005","full_name":"unional/fixture","owner":"unional","description":"Provide fixture to tests","archived":false,"fork":false,"pushed_at":"2026-03-09T18:00:02.000Z","size":1713,"stargazers_count":3,"open_issues_count":17,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-09T23:21:50.971Z","etag":null,"topics":["fixture","fixture-loading","fixtures","testing","testing-tools"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/unional.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"ko_fi":"unional"}},"created_at":"2018-02-28T09:21:17.000Z","updated_at":"2026-01-31T18:32:51.000Z","dependencies_parsed_at":"2023-11-01T18:35:40.681Z","dependency_job_id":"aca16e76-0c8d-42d5-88fa-c38c3942fd2f","html_url":"https://github.com/unional/fixture","commit_stats":null,"previous_names":[],"tags_count":61,"template":false,"template_full_name":null,"purl":"pkg:github/unional/fixture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unional%2Ffixture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unional%2Ffixture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unional%2Ffixture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unional%2Ffixture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unional","download_url":"https://codeload.github.com/unional/fixture/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unional%2Ffixture/sbom","scorecard":{"id":496021,"data":{"date":"2025-08-11","repo":{"name":"github.com/unional/fixture","commit":"5d16adc546e91aa2477846a8b9ee8fadc1c08938"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/4 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/pull-request.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/unional/fixture/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/unional/fixture/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:70: update your workflow using https://app.stepsecurity.io/secureworkflow/unional/fixture/codeql-analysis.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pull-request.yml:8: update your workflow using https://app.stepsecurity.io/secureworkflow/unional/fixture/pull-request.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:8: update your workflow using https://app.stepsecurity.io/secureworkflow/unional/fixture/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/unional/fixture/release.yml/main?enable=pin","Info:   1 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/unional/.github/.github/SECURITY.md:1","Info: Found linked content: github.com/unional/.github/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/unional/.github/.github/SECURITY.md:1","Info: Found text in security policy: github.com/unional/.github/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 26 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"14 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T20:26:13.361Z","repository_id":29933787,"created_at":"2025-08-19T20:26:13.361Z","updated_at":"2025-08-19T20:26:13.361Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30382674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T12:49:11.341Z","status":"ssl_error","status_checked_at":"2026-03-11T12:46:41.342Z","response_time":84,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["fixture","fixture-loading","fixtures","testing","testing-tools"],"created_at":"2024-10-11T03:07:30.592Z","updated_at":"2026-03-11T13:41:25.917Z","avatar_url":"https://github.com/unional.png","language":"TypeScript","funding_links":["https://ko-fi.com/unional"],"categories":[],"sub_categories":[],"readme":"# @unional/fixture\n\n[![NPM version][npm-image]][npm-url]\n[![NPM downloads][downloads-image]][downloads-url]\n\n[![GitHub NodeJS][github-nodejs]][github-action-url]\n[![Codecov][codecov-image]][codecov-url]\n\n[![Semantic Release][semantic-release-image]][semantic-release-url]\n\n[![Visual Studio Code][vscode-image]][vscode-url]\n\nProvides fixture for tests.\nYou can use it for any test runner such as `jest`, `ava`, `mocha`, `tap`, etc.\n\n## Install\n\n```sh\n# npm\nnpm install -D @unional/fixture\n\n# yarn\nyarn add -D @unional/fixture\n\n# pnpm\npnpm install -D @unional/fixture\n\n# rush\nrush add -p @unional/fixture --dev\n```\n\n## Usage\n\n`baseline()` is the heart of `@unional/fixture`.\nYou can use it to read a folder containing multiple test cases and use them in your test runner.\n\n```ts\nimport { baseline } from '@unional/fixture'\n\n// basic usage\nbaseline('fixtures', ({ caseName, caseType, casePath, resultPath, match, copyToBaseline }) =\u003e {\n  // `test()` comes from your favorite test runner.\n  // e.g. `ava`, `jest`, `mocha`\n  test(caseName, async () =\u003e {\n    // this example assumes `caseType === 'file'`,\n    // so the `casePath` points to the input file directly.\n    fs.readFileSync(casePath, 'utf-8')\n\n    // `resultPath` points to a folder where you can save your result(s)\n    fs.writeFileSync(path.join(resultPath, 'output.txt', '\u003csome data\u003e'))\n\n    // compare result and baseline folder\n    await match()\n\n    // match compares specific file in result folder and baseline folder\n    await match('output.txt')\n\n    // if you are happy with the change,\n    // use this to copy the artifacts from result folder to baseline folder,\n    // or you can do that manually from your IDE.\n    await copyToBaseline('*.txt')\n  })\n\n  // advance usage\n  baseline({\n    basePath: 'fixtures',\n    // default: 'cases'\n    casesFolder: 'scenarios',\n    // default: 'results'\n    resultsFolder: 'actuals',\n    // default: 'baselines'\n    baselinesFolder: 'expects',\n    // filter for specific cases\n    // can use wildcards or RegExp\n    filter: '*.pass',\n    // By default warning messages will be displayed when some test cases are filtered.\n    // Use this to suppress those warnings.\n    suppressFilterWarnings: true,\n    // If the file has more lines than this threshold,\n    // then the file will be diff with line numbers,\n    // and the unchanged lines will be trimmed off.\n    largeFileThreshold: 100,\n    // Controls how many unchanged lines will be shown around the changes.\n    largeFileAmbientLines: 5,\n    /**\n     * Maximum number of diff lines to show.\n     * If there are more diff lines,\n     * the remaining will be timmed and show a summary instead.\n     */\n    diffDisplayThreshold: 150\n  }, (context) =\u003e {\n    ...\n  })\n})\n\n```\n\n### Command Testing\n\nIn addition to `baseline()`,\n`@unional/fixture` provides `execCommand()` and `writeCommandResult()` to run command line test within the fixture.\n\nIf the test case is a JSON or YAML, it will read and execute the command within.\nIf the test case is a folder, it will look for a `command.json|yml|yaml` in the folder and does the same.\n\nMore file types and features will be added in the future.\n\nHere is a common way to use them:\n\n```ts\nimport { baseline, execCommand, writeCommandResult } from '@unional/fixture'\n\nbaseline('fixtures/command', ({ caseType, caseName, casePath, resultPath, match }) =\u003e {\n  it(caseName, async () =\u003e {\n    writeCommandResult(\n      resultPath,\n      await execCommand({ caseType, caseName, casePath })\n    )\n    return match()\n  })\n})\n```\n\nThe `execCommand()` has an alternative signature that allows you to easily run and capture `stdout` and `stderr`:\n\n```ts\nconst { stdout, stderr } = await execCommand({ casePath, command, args })\n```\n\n## Contribute\n\n```sh\n# right after fork\nyarn\n\n# begin making changes\ngit checkout -b \u003cbranch\u003e\nyarn watch\n\n# edit `webpack.config.dev.js` to exclude dependencies for the global build.\n\n# after making change(s)\ngit commit -m \"\u003ccommit message\u003e\"\ngit push\n\n# create PR\n```\n\n## Commands\n\nThere are a few useful commands you can use during development.\n\n```sh\n# Run tests (and lint) automatically whenever you save a file.\nyarn watch\n\n# Run tests with coverage stats (but won't fail you if coverage does not meet criteria)\nyarn test\n\n# Manually verify the project.\n# This will be ran during 'npm preversion' so you normally don't need to run this yourself.\nyarn verify\n\n# Build the project.\n# You normally don't need to do this.\nyarn build\n\n# Run tslint\n# You normally don't need to do this as `yarn watch` and `npm version` will automatically run lint for you.\nyarn lint\n```\n\n[codecov-image]: https://codecov.io/gh/unional/fixture/branch/master/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/unional/fixture\n[downloads-image]: https://img.shields.io/npm/dm/@unional/fixture.svg?style=flat\n[downloads-url]: https://npmjs.org/package/@unional/fixture\n[github-action-url]: https://github.com/unional/fixture/actions\n[github-nodejs]: https://github.com/unional/fixture/workflows/nodejs/badge.svg\n[npm-image]: https://img.shields.io/npm/v/@unional/fixture.svg?style=flat\n[npm-url]: https://npmjs.org/package/@unional/fixture\n[semantic-release-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\n[semantic-release-url]: https://github.com/semantic-release/semantic-release\n[vscode-image]: https://img.shields.io/badge/vscode-ready-green.svg\n[vscode-url]: https://code.visualstudio.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funional%2Ffixture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funional%2Ffixture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funional%2Ffixture/lists"}