A personal website for self-learning interest.
In your terminal, run the following command:
For local execution:
npm run dev
For test with watch
npm run test
For test coverage
npm run test:ci
For linting and prettifier check
npm run lint
For BackstopJS - regression for view and approve website design UI Note: that browser executes differently in OS, especially font's. In this case use the approved generated backstopJS snapshots directly from the OS/Docker container.
npm run backstop:test //To test
npm run backstop:approve // Approve the new website ok
- Install Vercel Cli, with
npm i -g vercel
- Pull all the environment into local with
vercel env pull .env.local
. This wil create an environment straight for testing. Incase, there are reset of environment to setup in Vercel, refer to .env file.
Project is tied closely with github.
To create a new change, do a pull request. (Master is still not locked)
- Create a branch for changes in lowercase with no space.
- Commit the changes in the branch.
- Push.
- In github, create a pull request.
- Check that the workflow is executed without error.
- Merge the commit.
In case there is a need to generate a new backstopJS approved page.
- In github, go to Actions tab.
- Select 'Create Approved Snapshot By File'.
- Click on 'Run workflow'
- Enter the vercel/public website to generate an approved website domain. Without http, e.g. https://www.walcron.com to www.walcron.com
- Manually enter a valid branch it can checkout, e.g. develop.
Updating backstopJS snapshot.
--By pull request
- Download the artifacts generated in "Summary" of the latest build. Replace generated snapshot in backstopdata/bitmaps_test//!failed_.png
- replace into bitmaps_reference.
--By action
- Download the artifacts generated in latest requested workflow. Replace generated snapshot in backstop_data/bitmaps_reference/*
- replace into bitmaps_reference.
--Auto approval (Recommended)
- Get the latest pipeline no from snapshotcheck.sh output from previous failed Validation workflow.
- OR view latest running script in github's Actions tab for Validation workflow.
- Execute the command below and it will auto-approve and rerun Validation workflow again.
echo ${running no# +1} > backstopjs.approve
git add backstopjs.approve
git push