Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add testing #115

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run build --if-present
- run: npm test
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@
},
"scripts": {
"format": "prettier --write \"./**/*.{js,json}\"",
"test": "node test.js"
"test": "bash tests/test.sh"
}
}
Empty file removed test.js
Empty file.
62 changes: 62 additions & 0 deletions tests/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
npm install -g

# Display data for all countries.
corona

# Display data for all countries in single color.
corona --xcolor

# Display data for given country i.e. China.
corona china

# Display data for all the US states.
corona states

# Display states data sorted by active cases.
corona states --sort active

# Display states data sorted by Cases today.
corona states -s cases-today

# Sort data by type
corona --sort country
corona --s cases

# All sorting parameters.
corona -s country
corona -s cases
corona -s cases-today
corona -s deaths
corona -s deaths-today
corona -s recovered
corona -s active
corona -s critical
corona -s per-million

# Reverse sort data
corona --sort active --reverse

# Print bar charts for max 10 countries.
timeout 10s corona --bar

# Print bar charts for top 5 countries w.r.t deaths.
timeout 10s corona --bar --sort deaths --limit 5

# Print bar charts countries w.r.t recovered cases.
timeout 10s corona --bar --sort recovered

# Print a country line chart.
timeout 10s corona usa --chart

# Print a country line chart with logarithmic data.
timeout 10s corona china --chart --log

# Print a limited number of entries to the output.
timeout 10s corona --limit 10


# Print a bare bones table with no info.
timeout 10s corona --minimal

# Display the help data.
corona help