{"id":15252900,"url":"https://github.com/airbnb/jest-wrap","last_synced_at":"2026-03-18T01:34:50.017Z","repository":{"id":46893735,"uuid":"81640042","full_name":"airbnb/jest-wrap","owner":"airbnb","description":"Fluent pluggable interface for easily wrapping `describe` and `it` blocks in Jest tests.","archived":false,"fork":false,"pushed_at":"2023-03-04T02:02:18.000Z","size":74,"stargazers_count":40,"open_issues_count":2,"forks_count":14,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-09-25T19:11:26.708Z","etag":null,"topics":["javascript","javascript-tests","jest","jest-tests","mocha","mocha-wrap","testing","testing-tools"],"latest_commit_sha":null,"homepage":null,"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/airbnb.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}},"created_at":"2017-02-11T08:14:29.000Z","updated_at":"2024-06-07T07:46:21.000Z","dependencies_parsed_at":"2022-09-26T22:20:22.544Z","dependency_job_id":"e08e4530-dc24-4b75-9b6f-1a865033cf25","html_url":"https://github.com/airbnb/jest-wrap","commit_stats":{"total_commits":62,"total_committers":6,"mean_commits":"10.333333333333334","dds":"0.33870967741935487","last_synced_commit":"3cc14027763e64044ed5189f09c0a8471c235778"},"previous_names":["ljharb/jest-wrap"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/airbnb/jest-wrap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airbnb%2Fjest-wrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airbnb%2Fjest-wrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airbnb%2Fjest-wrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airbnb%2Fjest-wrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/airbnb","download_url":"https://codeload.github.com/airbnb/jest-wrap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/airbnb%2Fjest-wrap/sbom","scorecard":{"id":173387,"data":{"date":"2025-08-11","repo":{"name":"github.com/airbnb/jest-wrap","commit":"3cc14027763e64044ed5189f09c0a8471c235778"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.6,"checks":[{"name":"Code-Review","score":2,"reason":"Found 7/24 approved changesets -- score normalized to 2","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":"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":"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":"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/node-4+.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/airbnb/jest-wrap/node-4+.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node-4+.yml:63: update your workflow using https://app.stepsecurity.io/secureworkflow/airbnb/jest-wrap/node-4+.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/node-4+.yml:64: update your workflow using https://app.stepsecurity.io/secureworkflow/airbnb/jest-wrap/node-4+.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/node-4+.yml:75: update your workflow using https://app.stepsecurity.io/secureworkflow/airbnb/jest-wrap/node-4+.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node-pretest.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/airbnb/jest-wrap/node-pretest.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/node-pretest.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/airbnb/jest-wrap/node-pretest.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node-pretest.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/airbnb/jest-wrap/node-pretest.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/node-pretest.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/airbnb/jest-wrap/node-pretest.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/rebase.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/airbnb/jest-wrap/rebase.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/rebase.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/airbnb/jest-wrap/rebase.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/require-allow-edits.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/airbnb/jest-wrap/require-allow-edits.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   7 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/node-4+.yml:1","Warn: no topLevel permission defined: .github/workflows/node-pretest.yml:1","Warn: no topLevel permission defined: .github/workflows/rebase.yml:1","Warn: no topLevel permission defined: .github/workflows/require-allow-edits.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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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":"Security-Policy","score":9,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/airbnb/.github/SECURITY.md:1","Info: Found linked content: github.com/airbnb/.github/SECURITY.md:1","Warn: One or no descriptive hints of disclosure, vulnerability, and/or timelines in security policy","Info: Found text in security policy: github.com/airbnb/.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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 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"}}]},"last_synced_at":"2025-08-16T17:07:57.568Z","repository_id":46893735,"created_at":"2025-08-16T17:07:57.569Z","updated_at":"2025-08-16T17:07:57.569Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30640232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-18T00:09:27.587Z","status":"ssl_error","status_checked_at":"2026-03-18T00:09:26.123Z","response_time":56,"last_error":"SSL_read: 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":["javascript","javascript-tests","jest","jest-tests","mocha","mocha-wrap","testing","testing-tools"],"created_at":"2024-09-29T20:06:39.563Z","updated_at":"2026-03-18T01:34:49.998Z","avatar_url":"https://github.com/airbnb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jest-wrap \u003csup\u003e[![Version Badge][2]][1]\u003c/sup\u003e\n\n[![Build Status][3]][4]\n[![dependency status][5]][6]\n[![dev dependency status][7]][8]\n[![License][license-image]][license-url]\n[![Downloads][downloads-image]][downloads-url]\n\n[![npm badge][11]][1]\n\nFluent pluggable interface for easily wrapping `describe`, `it`, and `test` blocks in Jest tests.\n\n## Example\n\n```js\nvar wrap = require('jest-wrap');\nvar expect = require('chai').expect;\n\nvar mockWindow = {\n\tlocation: {\n\t\thref: 'test/url'\n\t}\n};\nwrap().withGlobal('window', () =\u003e mockWindow).describe('mocked window', function () {\n\tit('is mocked', function () {\n\t\texpect(window).to.equal(mockWindow);\n\t});\n\n\tit('has the right URL', function () {\n\t\texpect(window.location.href).to.equal('test/url');\n\t});\n});\n\nvar obj = { a: 1 };\nwrap().withOverrides(() =\u003e obj, () =\u003e ({ a: 2, b: 3 })).describe('overridden object keys', function () {\n\tit('has \"b\"', function () {\n\t\texpect(obj.b).to.equal(3);\n\t});\n\n\tit('has overridden \"a\"', function () {\n\t\texpect(obj.a).to.equal(2);\n\t});\n});\n\nwrap().withOverride(() =\u003e obj, 'a', () =\u003e 4).skip().describe('this test is skipped', function () {\n\tit('also supports .only()!', function () {\n\t\texpect(true).to.equal(false); // skipped\n\t});\n});\n```\n\n## Plugins\nA `jest-wrap` **plugin** is a named function that returns a JestWrapper instance or a descriptor object.\n - A plugin’s function `name` must begin with the string “with”.\n - Plugins can be globally registered, or `.use`d ad-hoc.\n  - `.use` requires a plugin function as its first argument; further arguments are passed through to the plugin.\n  - `.extend` requires a non-empty description string, and a descriptor object which may contain a value that is a function, or an array of functions, whose keys correspond to any or all of the supported jest methods.\n - Globally registered plugins, `.use` calls, and `.extend` calls can be chained, stored, and reused - each link in the chain creates a new instance of a JestWrapper.\n\n - A descriptor object may contain any or all of these 5 keys:\n  - a `description` string, for use in “describe” and/or “it” (this is required when returning an object)\n  - `beforeEach`: a function, or array of functions, for use in a `jest` `beforeEach` function\n  - `afterEach`: a function, or array of functions, for use in a `jest` `afterEach` function\n  - `beforeAll`: a function, or array of functions, for use in a `jest` `beforeAll` function\n  - `afterAll`: a function, or array of functions, for use in a `jest` `afterAll` function\n\nThe most common approach will be for a plugin function to return `this.extend(description, descriptor)`.\n\nA plugin function must have a `name` that starts with “with”, and will be invoked with a receiver (”this” value) of a JestWrapper instance.\n\nTo register a plugin, call the `register` function on `jest-wrap` with the plugin function. This should not be done in a reusable module.\n\n```js\nmodule.exports = function withFoo(any, args, you, want) {\n\treturn this.extend('with some foo stuff', {\n\t\tbeforeEach: function () {\n\t\t\t// setup ran before each test\n\t\t},\n\t\tafterEach: [\n\t\t\tfunction () {\n\t\t\t\t// teardown ran after each test\n\t\t\t},\n\t\t\tfunction () {\n\t\t\t\t// more teardown\n\t\t\t}\n\t\t],\n\t\tbeforeAll: function () {\n\t\t\t// setup ran once before all tests\n\t\t},\n\t\tafterAll: function () {\n\t\t\t// teardown ran once after all tests\n\t\t}\n\t});\n};\n```\n\n## Usage\n```js\nvar wrap = require('jest-wrap');\nwrap.register(require('jest-wrap-with-foo'));\n\nwrap().withFoo().describe…\n```\n\n## skip/only\nAlthough jest has `describe.skip`, `describe.only`, `it.skip`, `it.only`, `test.skip`, and `test.only`, it is not possible to implement these in jest-wrap without using ES5 property accessors. Since this project supports ES3, we decided to use `.skip().describe` etc rather than forfeit the ability to have skip/only.\n\n## Tests\nSimply clone the repo, `npm install`, and run `npm test`\n\n[1]: https://npmjs.org/package/jest-wrap\n[2]: http://versionbadg.es/airbnb/jest-wrap.svg\n[3]: https://travis-ci.org/airbnb/jest-wrap.svg\n[4]: https://travis-ci.org/airbnb/jest-wrap\n[5]: https://david-dm.org/airbnb/jest-wrap.svg\n[6]: https://david-dm.org/airbnb/jest-wrap\n[7]: https://david-dm.org/airbnb/jest-wrap/dev-status.svg\n[8]: https://david-dm.org/airbnb/jest-wrap#info=devDependencies\n[11]: https://nodei.co/npm/jest-wrap.png?downloads=true\u0026stars=true\n[license-image]: http://img.shields.io/npm/l/jest-wrap.svg\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/jest-wrap.svg\n[downloads-url]: http://npm-stat.com/charts.html?package=jest-wrap\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fairbnb%2Fjest-wrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fairbnb%2Fjest-wrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fairbnb%2Fjest-wrap/lists"}