{"id":13561733,"url":"https://github.com/rintoj/chai-spec-generator","last_synced_at":"2026-06-15T03:33:31.101Z","repository":{"id":90422151,"uuid":"58130835","full_name":"rintoj/chai-spec-generator","owner":"rintoj","description":"VSCode Extension: This extension will generate chai test specs from a javascript object.","archived":false,"fork":false,"pushed_at":"2017-02-04T08:10:12.000Z","size":81,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-06-15T03:33:28.734Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rintoj.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-05-05T12:56:43.000Z","updated_at":"2019-03-04T16:00:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"45438c8c-475b-4371-a709-7c9be625f518","html_url":"https://github.com/rintoj/chai-spec-generator","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/rintoj/chai-spec-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rintoj%2Fchai-spec-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rintoj%2Fchai-spec-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rintoj%2Fchai-spec-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rintoj%2Fchai-spec-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rintoj","download_url":"https://codeload.github.com/rintoj/chai-spec-generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rintoj%2Fchai-spec-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34346867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"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":[],"created_at":"2024-08-01T13:01:00.463Z","updated_at":"2026-06-15T03:33:31.086Z","avatar_url":"https://github.com/rintoj.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Test Spec Generator\n\nThis extension will help you to generate test specs from an object or an array. Now supports `jasmine`, `chai` and `should` formats.\n\n## Usage\n\nSelect an object or an array in a text editor and press `CTRL + M` / `CMD(⌘) + M` or press `CMD+Shift+P` and search for `Generate Test Spec`\n\n![Command](images/command.png)\n\n## Example\n\nSelect the following object and run the command.\n\n### Source\n\n```ts\n{\n  status: 'deleted',\n  item: {\n    name: 'Sample User',\n    userId: 'sample1@user.com',\n    active: true,\n    roles: []\n  }\n}\n```\n### Output\n\nNote: Update `specGenerator.style` to select the style\n\n### **chai** style\n\n```ts\nexpect(result).be.a(\"object\");\nexpect(result).have.property(\"status\");\nexpect(result.status).be.equal(\"deleted\");\n\nexpect(result).have.property(\"item\");\nexpect(result.item).be.a(\"object\");\nexpect(result.item).have.property(\"name\");\nexpect(result.item.name).be.equal(\"Sample User\");\n\nexpect(result.item).have.property(\"userId\");\nexpect(result.item.userId).be.equal(\"sample1@user.com\");\n\nexpect(result.item).have.property(\"active\");\nexpect(result.item.active).be.equal(true);\n\nexpect(result.item).have.property(\"roles\");\nexpect(result.item.roles).be.a(\"array\");\nexpect(result.item.roles).be.empty;\n```\n\n### **should** style\n```ts\nresult.should.be.a(\"object\");\nresult.should.have.property(\"status\");\nresult.status.should.be.equal(\"deleted\");\n\nresult.should.have.property(\"item\");\nresult.item.should.be.a(\"object\");\nresult.item.should.have.property(\"name\");\nresult.item.name.should.be.equal(\"Sample User\");\n\nresult.item.should.have.property(\"userId\");\nresult.item.userId.should.be.equal(\"sample1@user.com\");\n\nresult.item.should.have.property(\"active\");\nresult.item.active.should.be.equal(true);\n\nresult.item.should.have.property(\"roles\");\nresult.item.roles.should.be.a(\"array\");\nresult.item.roles.should.be.empty;\n```\n\n### **jasmine** style\n```ts\nexpect(typeof result === \"object\" \u0026\u0026 !(result instanceof Array)).toBeTruthy();\nexpect(Object.keys(result)).toContain(\"status\");\nexpect(result.status).toEqual(\"deleted\");\n\nexpect(Object.keys(result)).toContain(\"item\");\nexpect(typeof result.item === \"object\" \u0026\u0026 !(result.item instanceof Array)).toBeTruthy();\nexpect(Object.keys(result.item)).toContain(\"name\");\nexpect(result.item.name).toEqual(\"Sample User\");\n\nexpect(Object.keys(result.item)).toContain(\"userId\");\nexpect(result.item.userId).toEqual(\"sample1@user.com\");\n\nexpect(Object.keys(result.item)).toContain(\"active\");\nexpect(result.item.active).toBe(true);\n\nexpect(Object.keys(result.item)).toContain(\"roles\");\nexpect(result.item.roles instanceof Array).toBeTruthy();\nexpect(result.item.roles.length).toEqual(0);\n```\n\n## Configuration\n\n| Configuration                   | Type      | Valid Values                       | Default Value | Description\n| ------------------------------- | --------- | ---------------------------------- | ------------- | -----------------------------\n| specGenerator.style             | `string`  | `jasmine`, `chai`, `should`        | `chai`        | Change spec style to 'jasmine', 'chai' or 'should'.\n| specGenerator.doubleQuote       | `boolean` | `true`, `false`                    | `false`       | Set to true for double quotes instead of single quotes.\n| specGenerator.semicolon         | `boolean` | `true`, `false`                    | `true`        | Set to true for adding semicolon at the end of each line\n| specGenerator.es6               | `boolean` | `true`, `false`                    | `true`        | Set to true to use es6 style where ever applicable.\n| specGenerator.variableName      | `string`  | any string value                   | `result`      | Default variable name for generating spec. Eg: 'expect(result).to.exist;'\n\n# Key Binding\n\nDefault key binding is as follows; Open `Code` \u003e\u003e `Preferences` \u003e\u003e `Keyboard Shortcuts` to edit this.\n\n```json\n{\n  \"command\": \"specGenerator.generate\",\n  \"key\": \"ctrl+m\",\n  \"mac\": \"cmd+m\"\n}\n```\n\n## Contributing\n\nContributions are welcome! Just send a pull request. Feel free to contact me or checkout my [Github](https://github.com/rintoj/chai-spec-generator) page.\n\n## Author\n\n**Rinto Jose** (rintoj)\n\nFollow me:\n  [Github](https://github.com/rintoj)\n| [Facebook](https://www.facebook.com/rinto.jose)\n| [Twitter](https://twitter.com/rintoj)\n| [Google+](https://plus.google.com/+RintoJoseMankudy)\n| [Youtube](https://youtube.com/+RintoJoseMankudy)\n\n## License\n\n```\nThe MIT License (MIT)\n\nCopyright (c) 2016 Rinto Jose (rintoj)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies 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,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```\n\n**Enjoy!**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frintoj%2Fchai-spec-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frintoj%2Fchai-spec-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frintoj%2Fchai-spec-generator/lists"}