1.0.0 • Published 6 months ago

lineman-api-test-jest v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

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 node

if you already have node, please upgrade using the following command

sh$ brew update
sh$ brew upgrade node

Editor

  • 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=true

To install dependency libraries. Navigate to project root directory (directory that contains package.json file)

sh$ yarn install

Please KEEP UPDATE your library version by running command above.

How to Run

Run tests via command line interface

sh$ yarn jest

To specific environment

sh$ configFile=beta2 yarn jest

To specific test case file

sh$ yarn jest {filename without ".spec.js"}

To log axios request and response

sh$ log=debug yarn jest

Configuration 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:check

To do static analysis, code formatter and fix

sh$ yarn jest:lint

To do code formatter

sh$ yarn  jest:prettier