Qantas Code Test
http://kieradog.github.io/Qantas-Code-Test
React, Storybook, Storybook Snapshot Test, Jest Unit Test (@testing-library/react), Basic Webpack and Babel.
Test Coverage: 99.08%
- Target: > 0.25%, not dead
- Tested: Chrome, Safari
- E2E might fail because it required to start server on 8080, need docker
- Some Component is not 100% covered, because of guarded by
propTypes
- The
props
andonChange
function ofSortSelect
need documented,{ key: string, directions: Direction[]}
and{ key: string, direction: Direction }
- using
styled-components@3
, because of v4'sjest-styled-components
is not supported
- Git
- Node(& npm): any 10.x version starting with 10.13.0 or greater
npm i
to install the website's npm dependencies
npm run start:dev
to start the hot-reloading development server- open http://localhost:8080 to open the site in your favorite browser
- Tool: Webpack, Webpack Dev Server
npm run storybook
to start the hot-reloading storybook server- open https://localhost:6006 to open the storybook in your favorite browser
- Tool: Storybook
npm i
to install the website's npm dependenciesnpm run test
to run Lint, Unit Test, Snapshot Test, E2E Test.
ESLint, check syntax, find problems, and enforce code style.
- Tool: ESLint
- Style Guide: airbnb
npm run test:unit
to run unit test (./src/components/**/*.spec.jsx
)
- Tool: Jest, @testing-library/react
npm run test:snap
to run snapshot test (./src/components/**/*.stories.jsx
)
- Tool: Jest, Storybook
- Test Config:
./storyshots/storyshots.spec.js
- Snapshots:
./storyshots/__snapshots__/storyshots.spec.js
npm run test:e2e
to run E2E test
- Tool: Jest, Puppeteer, jest-puppeteer
npm run build
to build website artifacts
- Tool: Webpack, Babel
- Artifacts:
./dist
npm run deploy
to deploy to Github Page
- Long Zhao, [email protected]