{"id":15099043,"url":"https://github.com/jsdir/chai-jsend","last_synced_at":"2026-01-06T09:32:46.372Z","repository":{"id":19816602,"uuid":"23077206","full_name":"jsdir/chai-jsend","owner":"jsdir","description":"Chai plugin for asserting JSend responses.","archived":false,"fork":false,"pushed_at":"2015-01-11T00:02:03.000Z","size":184,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T12:31:51.775Z","etag":null,"topics":[],"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/jsdir.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}},"created_at":"2014-08-18T15:53:12.000Z","updated_at":"2015-01-11T00:02:03.000Z","dependencies_parsed_at":"2022-08-25T21:40:34.756Z","dependency_job_id":null,"html_url":"https://github.com/jsdir/chai-jsend","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/jsdir%2Fchai-jsend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdir%2Fchai-jsend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdir%2Fchai-jsend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdir%2Fchai-jsend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsdir","download_url":"https://codeload.github.com/jsdir/chai-jsend/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245854878,"owners_count":20683429,"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-09-25T17:03:25.086Z","updated_at":"2026-01-06T09:32:41.346Z","avatar_url":"https://github.com/jsdir.png","language":"JavaScript","readme":"chai-jsend\n==========\n\n[![Build Status](https://img.shields.io/travis/jsdir/chai-jsend.svg?style=flat)](https://travis-ci.org/jsdir/chai-jsend)\n[![Dependency Status](https://img.shields.io/david/jsdir/chai-jsend.svg?style=flat)](https://david-dm.org/jsdir/chai-jsend)\n[![NPM version](https://img.shields.io/npm/v/chai-jsend.svg?style=flat)](https://www.npmjs.org/package/chai-jsend)\n\n\nChai plugin for asserting JSend responses.\n\nInstallation\n------------\n\n`npm install --save-dev chai-jsend`\n\nAssertions\n----------\n\n## Success\n\n- `success`\n- `successWith`\n\n### Usage:\n\n```js\ndescribe('success', function() {\n  it('should succeed', function(done) {\n    req.get('/users/1').end(function(err, res) {\n      if (err) {return done(err);}\n      res.should.be.success;\n      res.should.be.successWith({name: 'Random'});\n    });\n  });\n});\n```\n\n## Failure\n\n- `failure`\n- `failureWith`\n\n### Usage:\n\n```js\ndescribe('failure', function() {\n  it('should fail', function(done) {\n    req.get('/users/1').end(function(err, res) {\n      if (err) {return done(err);}\n      res.should.be.failure;\n      res.should.be.failureWith({id: 'Unknown user.'});\n    });\n  });\n});\n```\n\n## Error\n\n- `error`\n- `errorWith`\n\n### Usage:\n\n```js\ndescribe('errors', function() {\n  it('should error', function(done) {\n    req.get('/users/1').end(function(err, res) {\n      if (err) {return done(err);}\n      res.should.be.error;\n      res.should.be.errorWith('Server error.');\n      res.should.be.errorWith({\n        code: 500,\n        message: 'Server error.',\n        data: {power_level: 9001}\n      });\n    });\n  });\n});\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsdir%2Fchai-jsend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsdir%2Fchai-jsend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsdir%2Fchai-jsend/lists"}