{"id":15017389,"url":"https://github.com/avrelian/jasmine2-custom-message","last_synced_at":"2025-08-21T10:31:01.033Z","repository":{"id":1095381,"uuid":"39768055","full_name":"avrelian/jasmine2-custom-message","owner":"avrelian","description":"custom failure message on any jasmine v2 assertion","archived":false,"fork":false,"pushed_at":"2023-04-16T16:27:08.000Z","size":273,"stargazers_count":27,"open_issues_count":10,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-03T17:56:01.464Z","etag":null,"topics":["assertions","custom-message","jasmine","jasmine2"],"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/avrelian.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}},"created_at":"2015-07-27T10:11:59.000Z","updated_at":"2021-04-01T14:05:30.000Z","dependencies_parsed_at":"2023-07-07T16:33:50.164Z","dependency_job_id":null,"html_url":"https://github.com/avrelian/jasmine2-custom-message","commit_stats":{"total_commits":79,"total_committers":7,"mean_commits":"11.285714285714286","dds":0.189873417721519,"last_synced_commit":"eb10e8b5cff87c1a95e5c17b90cba2570fdec794"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/avrelian/jasmine2-custom-message","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrelian%2Fjasmine2-custom-message","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrelian%2Fjasmine2-custom-message/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrelian%2Fjasmine2-custom-message/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrelian%2Fjasmine2-custom-message/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avrelian","download_url":"https://codeload.github.com/avrelian/jasmine2-custom-message/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrelian%2Fjasmine2-custom-message/sbom","scorecard":{"id":218608,"data":{"date":"2025-08-11","repo":{"name":"github.com/avrelian/jasmine2-custom-message","commit":"eb10e8b5cff87c1a95e5c17b90cba2570fdec794"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":4,"reason":"Found 8/19 approved changesets -- score normalized to 4","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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"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":"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":"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":"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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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 19 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":"45 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-3v6h-hqm4-2rg6","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-6cpc-mj5c-m9rq","Warn: Project is vulnerable to: GHSA-rq8g-5pc5-wrhr","Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-957j-59c2-j692","Warn: Project is vulnerable to: GHSA-qh2h-chj9-jffq","Warn: Project is vulnerable to: GHSA-m5pj-vjjf-4m3h","Warn: Project is vulnerable to: GHSA-j383-35pm-c5h4","Warn: Project is vulnerable to: GHSA-rm36-94g8-835r","Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-8g7p-74h8-hg48","Warn: Project is vulnerable to: GHSA-pc5p-h8pf-mvwp","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-jg8v-48h5-wgxg","Warn: Project is vulnerable to: GHSA-36fh-84j7-cv5h","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-fvqr-27wr-82fm","Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574","Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-hxm2-r34f-qmc5","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-x3m3-4wpv-5vgc","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj","Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3","Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq","Warn: Project is vulnerable to: GHSA-v2p6-4mp7-3r9v","Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc"],"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-17T02:05:43.925Z","repository_id":1095381,"created_at":"2025-08-17T02:05:43.925Z","updated_at":"2025-08-17T02:05:43.925Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271274198,"owners_count":24730964,"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-20T02:00:09.606Z","response_time":69,"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":["assertions","custom-message","jasmine","jasmine2"],"created_at":"2024-09-24T19:50:23.691Z","updated_at":"2025-08-21T10:31:00.777Z","avatar_url":"https://github.com/avrelian.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"jasmine2-custom-message\n======================\n\u003e **works with `jasmine v2`** (for work with `jasmine v1.3` see [jasmine-custom-message](https://github.com/avrelian/jasmine-custom-message))\n\n\nThis script makes it possible to use your own failure message on any jasmine assertion.\n\n#### Example\n\n```js\ndescribe('the story', function() {\n  it('should finish ok', function() {\n    since('all cats are grey in the dark').\n    expect('tiger').toEqual('kitty'); // =\u003e 'all cats are grey in the dark'\n  });\n});\n```\n\n\n## Simple\n\nAll the magic happens in `since` function. That returns an object with a property `expect`. That contains no more than a wrapped jasmine `expect` function. That returns jasmine `expectation` object with a wrapped `addExpectationResult` function. That can replace an ordinary jasmine failure message with a newly generated one. That is generating based on a custom message you have supplied to `since` function as the first argument. That can be a primitive (except `null` and `undefined`), a function, or any other object. That is it.\n\n#### Example\n\n```js\ndescribe('test', function() {\n  it('should be ok', function() {\n    since(function() {\n      return {'tiger': 'kitty'};\n    }).\n    expect(3).toEqual(4); // =\u003e '{\"tiger\":\"kitty\"}'\n  });\n});\n```\n\n\n## Unobtrusive\n\nYou can use jasmine as you did before, since `jasmine2-custom-message` does not replace global jasmine `expect` function.\n\n#### Example\n\n```js\ndescribe('test', function() {\n  it('should be ok', function() {\n    expect(3).toEqual(4); // =\u003e ordinary jasmine message\n  });\n});\n```\n\n\n## Powerful\n\nYou can use expected and actual values of the assertion in your custom message by:\n\n  * Passing a function, and using `this.actual` and `this.expected`\n  * Passing a string, and using `#{actual}` and `#{expected}`\n\nYou can include the full original message from Jasmine by:\n\n  * Passing a function, and using `this.message`\n  * Passing a string, and using `#{message}`\n\n#### Examples using a function\n\n```js\ndescribe('test', function() {\n  it('should be ok', function() {\n    since(function() {\n      return this.actual + ' =/= ' + this.expected;\n    }).\n    expect(3).toEqual(4); // =\u003e '3 =/= 4'\n  });\n});\n```\n\n```js\ndescribe('multiple tests that need some context added to the message', function() {\n    it('should be ok for all options', function() {\n      // passes the 1st loop iteration, fails the 2nd\n      [1, 2, 3, 4, 5].forEach(testOptionIndex =\u003e {\n        since(function() {\n          return 'for test option ' + testOptionIndex + ': ' + this.message;\n        }).\n        expect(testOptionIndex).toEqual(1); // =\u003e for test option 2: Expected 2 to equal 1.  \n      });\n    });\n});\n```\n\n#### Example using a string\n\n```js\ndescribe('test', function() {\n  it('should be ok', function() {\n    since('#{actual} =/= #{expected}').\n    expect(3).toEqual(4); // =\u003e '3 =/= 4'\n  });\n});\n```\n\n```js\ndescribe('multiple tests that need some context added to the message', function() {\n    it('should be ok for all options', function() {\n      // passes the 1st loop iteration, fails the 2nd\n      [1, 2, 3, 4, 5].forEach(testOptionIndex =\u003e {\n        since('for test option ' + testOptionIndex + ': #{message}').\n        expect(testOptionIndex).toEqual(1); // =\u003e for test option 2: Expected 2 to equal 1.  \n      });\n    });\n});\n```\n\n## Front-end usage\n*  install the bower package from github\n```\nbower install jasmine2-custom-message --save-dev\n```\n* include `jasmine2-custom-message.js` into your HTML file next to `jasmine` script\n```html\n\u003cscript src=\"PATH-TO/jasmine.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"PATH-TO/jasmine2-custom-message.js\"\u003e\u003c/script\u003e\n```\n\n## Node.js usage\n\n*  install the bower package from github\n```\n$ bower install jasmine2-custom-message --save-dev\n```\n\nor\n```\n$ npm install jasmine2-custom-message --save-dev\n```\n\n*  require it in your spec file before your tests\n```js\nrequire('jasmine2-custom-message');\n```\n* or be explicit in any functional scope\n```js\nvar since = require('jasmine2-custom-message');\n```\n\n## Change log\n\nv0.9.0 - 2018.03.01\n\n  * improved \"format string\" functionality: `#{message}` added for the original jasmine2 error message (kudos to Keith Zimmerman)\n  * corrected output for `toHaveBeenCalled` matcher (kudos to Holger Jeromin)\n  * updated `protractor` environment (kudos to Keith Zimmerman)\n  * added `typescript` definitions (kudos to Holger Jeromin and Andrew N Marshall)\n  * updated specs\n\nv0.8.0 - 2015.08.05\n\n  * implemented \"format string\" functionality: `#{actual}` and `#{expected}`\n  * configured `protractor` environment\n  * corrected displaying of colors in tests running through `protractor`\n  * updated specs\n\nv0.7.0 - 2014.10.23\n\n  * fixed issue with custom failure messages on inverse assertions\n  * updated specs\n\n`v0.6.0` - 2014.01.18 - **BROKEN COMPATIBILITY!**\n  * all the magic moved into newly introduced `since` function\n  * restored automatic initiation of the script upon inclusion (browser) or require (Node.js)\n  * cleaned specs\n\n`v0.5.0` - 2014.01.15\n  * added support for nested message functions\n  * dropped automatic wrapping of jasmine `it` and `expect` functions in browsers\n  * added specs for Node.js\n  * added specs for browsers\n  * registered bower package\n  * made disambiguation and readability improvements\n\n`v0.2.0` - 2014.01.10\n  * BROKEN COMPATIBILITY: custom messages is supplied as the third argument for jasmine `it` function\n\n`v0.1.0` - 2014.01.08\n  * the first functional version  \n\n\n## Release plan\n\n`v1.0.0` - some new features and updates (based on requests from Issues)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favrelian%2Fjasmine2-custom-message","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favrelian%2Fjasmine2-custom-message","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favrelian%2Fjasmine2-custom-message/lists"}