{"id":21064069,"url":"https://github.com/luochen1990/js-unit-test-demo","last_synced_at":"2025-06-21T08:37:40.688Z","repository":{"id":28979304,"uuid":"32505790","full_name":"luochen1990/js-unit-test-demo","owner":"luochen1990","description":"Demo for javascript unit test frameworks (mocha/jasmine + chai + karma)","archived":false,"fork":false,"pushed_at":"2015-03-19T10:45:40.000Z","size":152,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-20T20:49:53.190Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luochen1990.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":"2015-03-19T06:55:42.000Z","updated_at":"2015-09-07T10:01:50.000Z","dependencies_parsed_at":"2022-09-05T11:50:28.472Z","dependency_job_id":null,"html_url":"https://github.com/luochen1990/js-unit-test-demo","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/luochen1990%2Fjs-unit-test-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luochen1990%2Fjs-unit-test-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luochen1990%2Fjs-unit-test-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luochen1990%2Fjs-unit-test-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luochen1990","download_url":"https://codeload.github.com/luochen1990/js-unit-test-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243506855,"owners_count":20301768,"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-11-19T17:48:12.986Z","updated_at":"2025-03-14T01:24:58.797Z","avatar_url":"https://github.com/luochen1990.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Javascript单元测试框架Demo\n==========================\n\n这个Demo主要是用来演示js的单元测试框架及一些配套工具的使用。\n\n`Mocha/`目录用来演示 `Mocha`, `Mocha + chai`, `Mocha + chai + Karma` 的使用\n`Jasmine/`目录用来演示 `Jasmine`, `Jasmine + chai`, `Jasmine + chai + Karma` 的使用\n\n[compare.md文件](compare.md)中罗列了一些两者的比较\n[all.md文件](all.md)中有完整的调研报告\n\nHow To Run\n----------\n\n要运行 `* + Karma` 的演示，需要先用npm全局安装karma-cli：`/\u003e npm install -g karma-cli`\n\n### Mocha\n\n- 安装Mocha：`/\u003e npm install -g mocha` (我使用的版本是mocha@2.2.1)\n- 安装依赖模块：`Mocha\u003e npm install`\n- 运行测试代码（`Mocha + chai`）：`Mocha\u003e mocha`\n- 运行测试代码（`Mocha + chai + Karma`）：`Mocha\u003e karma start`\n\n### Jasmine\n\n- 安装Jasmine：`/\u003e npm install -g jasmine` (我使用的版本是jasmine@2.2.1)\n- 安装依赖模块：`Jasmine\u003e npm install`\n- 运行测试代码（`Jasmine + chai`）：`Jasmine\u003e jasmine`\n- 运行测试代码（`Jasmine + chai + Karma`）：`Jasmine\u003e karma start`\n\nTodo\n----\n\n尚未解决karma 和 commonjs require 一起使用时的问题：https://github.com/karma-runner/karma-commonjs/issues/29\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluochen1990%2Fjs-unit-test-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluochen1990%2Fjs-unit-test-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluochen1990%2Fjs-unit-test-demo/lists"}