{"id":17513006,"url":"https://github.com/mimiz/chai-catch-exception","last_synced_at":"2026-05-04T03:33:56.386Z","repository":{"id":14579193,"uuid":"17295537","full_name":"mimiz/chai-catch-exception","owner":"mimiz","description":"A ChaiJs Plugin inspired by catch-exception for Java","archived":false,"fork":false,"pushed_at":"2014-03-01T21:26:18.000Z","size":152,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-03T09:02:44.086Z","etag":null,"topics":[],"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/mimiz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-28T18:29:07.000Z","updated_at":"2014-08-04T12:23:01.000Z","dependencies_parsed_at":"2022-08-30T16:11:15.429Z","dependency_job_id":null,"html_url":"https://github.com/mimiz/chai-catch-exception","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mimiz%2Fchai-catch-exception","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mimiz%2Fchai-catch-exception/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mimiz%2Fchai-catch-exception/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mimiz%2Fchai-catch-exception/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mimiz","download_url":"https://codeload.github.com/mimiz/chai-catch-exception/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246106658,"owners_count":20724400,"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","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-10-20T06:06:41.164Z","updated_at":"2026-05-04T03:33:51.361Z","avatar_url":"https://github.com/mimiz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"chai-catch-exception\n====================\n A ChaiJS Plugin inspired by catch-exception for Java\n\n[![Build Status](https://travis-ci.org/mimiz/chai-catch-exception.png?branch=master)](https://travis-ci.org/mimiz/chai-catch-exception)\n\n\n\n## Usage :\n\nThe idea is to replace something like this :\n\n    it(\"Should throw error when array contains a NaN, [1,'']\", function(){\n\n       expect(function(){ median([1,\"\"]);}).to.throw(Error, \"Must only contains numbers\");\n\n    });\n\nOR the readable way ...\n\n    it(\"Should throw error when array contains a NaN, [1,'']\", function(){\n\n        // We need to encapsulate the function call so it won't be evaluated\n        var fn = function(){\n            median([1, \"\"]);\n        };\n\n       expect(fn).to.throw(Error, \"Must only contains numbers\");\n\n    });\n\n\nWith this :\n\n    it(\"Should throw error when array contains a NaN, [1,'']\", function(){\n\n        expect(median).withParams([1,\"\"]).to.throw(Error, \"Must only contains numbers\");\n\n    });\n\nwhich we find more readable !\n\n## Todo\n\n * We still need to write tests with all assertion types : should, expect ...\n * Packages for npm and bower\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2014 Rémi Goyard \u0026 Christian Alonso Chavez Ley\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmimiz%2Fchai-catch-exception","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmimiz%2Fchai-catch-exception","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmimiz%2Fchai-catch-exception/lists"}