lineman-api-test-jest v1.0.0
LINE MAN API Test with Jest
This is a test automation for LINEMAN test. It provides API using Jest library
Development Setup
Prerequisite
- nodeJS >= 12.0.0
sh$ brew install nodeif you already have node, please upgrade using the following command
sh$ brew update
sh$ brew upgrade nodeEditor
- We recommended using Visual Studio Code as an Editor. It's lightweight, fast and extendable with many plugins supported.
- Suggested vscode add-ons.
- ESLint
- Prettier
Setup
To Login to Wongnai private-registry, please use your git account (LDAP) when asked for credentials.
npm login --registry=https://nexus.wndv.co/repository/wnnpm/Create new file name .npmrc at project root folder and add the following
registry=https://nexus.wndv.co/repository/wnnpm/
always-auth=trueTo install dependency libraries. Navigate to project root directory (directory that contains package.json file)
sh$ yarn installPlease KEEP UPDATE your library version by running command above.
How to Run
Run tests via command line interface
sh$ yarn jestTo specific environment
sh$ configFile=beta2 yarn jestTo specific test case file
sh$ yarn jest {filename without ".spec.js"}To log axios request and response
sh$ log=debug yarn jestConfiguration File
You can specify configuration paramters in jest\dev.env
To specific environment file you can pass environment variable from command line
sh$ configFile=dev npm run jest {filename without ".spec.js"}ESLint + Prettier
Please do the following step before PR To check code error from static analysis
sh$ yarn jest:lint:checkTo do static analysis, code formatter and fix
sh$ yarn jest:lintTo do code formatter
sh$ yarn jest:prettier11 months ago