A Hacker News clone with tests, written for the book Testing Vue.js Applications
Branches in the format chapter-<number>
are cloned from the original repo.
Branches in the format chapter-<number>-do
are where I tried to follow along with the instructions in the book to write tests.
Any issues encountered or notable points I learn while playing around with this will be added into this README as a reference.
If you are also following along with the book, you will find chapter 2 to be full of frustrating errors. Please check out the errata to pin your package versions.
Even despite pinning package versions, an import error may occur in chapter 2 as babel fails to transpile. Try adding the following to your package.json to resolve the issue. It worked for me.
"jest": { "transform": { "^.+\\.vue$": "vue-jest", "^.+\\.(js|jsx)?$": "<rootDir>/node_modules/babel-jest" } }
If it is still too frustrating, you'll have to skip doing Chapter 2. Just read through, internalise the messages, then $git checkout chapter-3
and $npm install
and you should be able to follow along with Chapter 3 just fine.
Run full suite:
npm run test
Unit tests:
npm run test:unit
Integration tests:
npm run test:integration
E2E tests:
npm run test:e2e
Run the development server:
npm run serve