{"id":18867882,"url":"https://github.com/stryker-mutator/robo-coasters-example","last_synced_at":"2025-08-21T15:33:14.390Z","repository":{"id":42246466,"uuid":"128725081","full_name":"stryker-mutator/robo-coasters-example","owner":"stryker-mutator","description":"An example project for Stryker","archived":false,"fork":false,"pushed_at":"2024-10-22T12:48:06.000Z","size":7155,"stargazers_count":18,"open_issues_count":3,"forks_count":33,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-11T05:51:40.903Z","etag":null,"topics":["coverage","javascript","mutation-testing","test-automation","test-tools","testing"],"latest_commit_sha":null,"homepage":"https://stryker-mutator.io/robo-coasters-example","language":"JavaScript","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/stryker-mutator.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-09T06:29:52.000Z","updated_at":"2024-11-17T07:32:55.000Z","dependencies_parsed_at":"2024-08-22T09:00:00.017Z","dependency_job_id":"91d45877-b1a7-4802-a915-881d45491cdf","html_url":"https://github.com/stryker-mutator/robo-coasters-example","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/stryker-mutator%2Frobo-coasters-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stryker-mutator%2Frobo-coasters-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stryker-mutator%2Frobo-coasters-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stryker-mutator%2Frobo-coasters-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stryker-mutator","download_url":"https://codeload.github.com/stryker-mutator/robo-coasters-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230520394,"owners_count":18238948,"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":["coverage","javascript","mutation-testing","test-automation","test-tools","testing"],"created_at":"2024-11-08T05:11:44.489Z","updated_at":"2024-12-20T01:16:22.005Z","avatar_url":"https://github.com/stryker-mutator.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Code coverage badge](https://img.shields.io/badge/coverage-100%25-brightgreen)](https://stryker-mutator.io/robo-coasters-example/reports/coverage/lcov-report/index.html)\n[![Mutation testing badge](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fstryker-mutator%2Frobo-coasters-example%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/stryker-mutator/robo-coasters-example/master)\n\n# Welcome to RoboCoasters\n\n\u003e An introduction to mutation testing\n\n_How code coverage of 100% could mean only 60% is tested._\n\n## TL;DR\n\nNo time to run the example yourself? Don't worry; we did it for you. Open it right in your browser:\n\n- [The RoboCoasters website](https://stryker-mutator.io/robo-coasters-example/)\n- [Coverage report](https://stryker-mutator.io/robo-coasters-example/reports/coverage/lcov-report/index.html)\n- [Mutation report](https://dashboard.stryker-mutator.io/reports/github.com/stryker-mutator/robo-coasters-example/master)\n\n## What is this?\n\nRoboCoasters is a small application to demo mutation testing. It has a fair amount of unit tests. We didn't try our best to write bad tests when we wrote this application. We just focussed on code coverage and didn't practice Test Driven Development. It turns out it's easy to write bad tests or forget a few important test cases. RoboCoasters even has a fairly large bug. Finding it is easy using the mutation report. Why don't you give it a try? 😁\n\n**Note:** Robo coasters is developed using [native web components](https://developer.mozilla.org/en-US/docs/Web/Web_Components) without a frontend framework. This is done on purpose to keep this example as accessible as possible and to keep the maintenance burden low.\n\n## Try it yourself\n\n1. Install [git](https://git-scm.com)\n1. Install [nodejs](https://nodejs.org/)\n1. Open command prompt and clone this repository:\n   ```shell\n   git clone https://github.com/stryker-mutator/robo-coasters-example\n   ```\n1. Change directory into `robo-coasters-example` and install the dependencies.\n   ```shell\n   cd robo-coasters-example\n   npm install\n   ```\n1. Run tests with npm. This will generate a code coverage report.\n   ```shell\n   npm test\n   ```\n1. Review the 100% code coverage score. Open up the code coverage report in the `reports/coverage/lcov-report` directory.\n1. Run mutation testing with [Stryker](https://stryker-mutator.io)\n   ```shell\n   npm run test:mutation\n   ```\n1. Review the less than 60% mutation score. Open up the mutation report in the `reports/mutation` directory.\n1. Run the website with `npm start`. Can you find the bug?\n\n## Try to install stryker yourself.\n\nIf you want to install stryker yourself, step back in history using git:\n\n```shell\ngit checkout pre-stryker\nnpm install\n```\n\nAfter that you can install stryker for yourself:\n\n```shell\nnpm init stryker\n```\n\nChoose the following options in the questionnaire:\n\n- **Are you using one of these frameworks?** `None/other`\n- **Which test runner do you want to use?** `jest`\n- **Reporters**: `html`, `clear-text`, `progress`\n- **Which package manager do you want to use?**: `npm`\n- **What file type do you want for your config file?**: `json`\n\nAfter the plugins are installed, open the `stryker.conf.json` file and make the following change:\n\n```diff\n{\n  \"$schema\": \"./node_modules/@stryker-mutator/core/schema/stryker-schema.json\",\n  \"_comment\": \"This config was generated using 'stryker init'. Please take a look at: https://stryker-mutator.io/docs/stryker-js/configuration/ for more information\",\n  \"packageManager\": \"npm\",\n  \"reporters\": [\n    \"html\",\n    \"clear-text\",\n    \"progress\",\n    \"dashboard\"\n  ],\n  \"testRunner\": \"jest\",\n- \"coverageAnalysis\": \"perTest\"\n+ \"coverageAnalysis\": \"perTest\",\n+ \"testRunnerNodeArgs\": [\"--experimental-vm-modules\"]\n}\n```\n\n(this is needed because we're using [jest with ECMAScript modules](https://jestjs.io/docs/ecmascript-modules))\n\nAfter the plugins are installed, try it out:\n\n```shell\nnpx stryker run\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstryker-mutator%2Frobo-coasters-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstryker-mutator%2Frobo-coasters-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstryker-mutator%2Frobo-coasters-example/lists"}