{"id":18823894,"url":"https://github.com/eddyerburgh/vue-unit-test-perf-comparison","last_synced_at":"2025-04-14T01:31:04.666Z","repository":{"id":24897385,"uuid":"102708533","full_name":"eddyerburgh/vue-unit-test-perf-comparison","owner":"eddyerburgh","description":"Comparison of Vue SFC unit tests using different test runners","archived":false,"fork":false,"pushed_at":"2023-01-12T09:53:00.000Z","size":577,"stargazers_count":64,"open_issues_count":52,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-27T15:47:40.844Z","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/eddyerburgh.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":"2017-09-07T07:56:38.000Z","updated_at":"2024-03-29T13:25:29.000Z","dependencies_parsed_at":"2023-01-14T13:29:53.156Z","dependency_job_id":null,"html_url":"https://github.com/eddyerburgh/vue-unit-test-perf-comparison","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/eddyerburgh%2Fvue-unit-test-perf-comparison","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddyerburgh%2Fvue-unit-test-perf-comparison/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddyerburgh%2Fvue-unit-test-perf-comparison/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddyerburgh%2Fvue-unit-test-perf-comparison/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eddyerburgh","download_url":"https://codeload.github.com/eddyerburgh/vue-unit-test-perf-comparison/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248807419,"owners_count":21164687,"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-08T00:54:58.188Z","updated_at":"2025-04-14T01:31:04.640Z","avatar_url":"https://github.com/eddyerburgh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vue Unit Test Performance Comparison\n\nThis is a performance comparison between test runners testing Vue SFCs.\n\n## Comparison\n\n| Runner        | 10 tests  | 100 tests  | 1000 tests | 5000 tests |\n| :------------ |:--------- |:---------  |:---------  |:--------- |\n| tape | 2.32s |  3.49s |  9.28s |  38.31s |\n| jest | 2.44s |  4.50s |  21.84s |  91.91s |\n| mocha-webpack | 2.32s |  3.07s |  10.79s |  38.97s |\n| karma-mocha | 7.93s |  11.01s |  33.30s |  119.34s |\n| ava | 19.05s |  73.44s |  625.15s |  7161.49s |\n\n## Details\n\nThe tests use two SFC. You can see the tests inside the runner directories.\n\nThe time is the average of 10 runs.\n\n## Results\n\nCurrently tape is the fastest.\n\nAVA is by far the slowest. This is because the [current suggested method](https://github.com/avajs/ava/blob/master/docs/recipes/precompiling-with-webpack.md) does not utilize caching. If caching was added, it would be comparable to Jest.\n\n## Usage\n\nRunning the test script will generate a results table in RESULTS.md:\n\n```\nnpm test\n```\n\n**Warning: It takes around 5 minutes to run**\n\n## Contributing\n\nFeel free to add an extra test setup. The aim of this project is to find the best setup out there.\n\n### Add a new setup\n* Create directory with a descriptive name, using test template below\n* Add `Basic.spec.js` file with 30 tests\n* Create a `test` script in your package.json\n* Add name of directory to `test_runners` array in `test.sh`\n* Run tests from the root by running `npm test`\n\n### Test template\nCopy this and change the syntax to match your test runner.\n```js\nit('renders correct text', () =\u003e {\n  const wrapper = shallow(Basic)\n  expect(wrapper.find('.hello h1').text()).toBe('Welcome to Your Vue.js App')\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddyerburgh%2Fvue-unit-test-perf-comparison","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feddyerburgh%2Fvue-unit-test-perf-comparison","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddyerburgh%2Fvue-unit-test-perf-comparison/lists"}