Skip to content

Commit

Permalink
✅ add test for CLI run
Browse files Browse the repository at this point in the history
  • Loading branch information
juanesarango committed Dec 12, 2023
1 parent 5945094 commit d846955
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/cli-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CLI Test

on: [push]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Install CLI globally
run: npm install -g .

- name: Test CLI
run: |
# Run the CLI with the example file
OUTPUT=$(ipssm test/data/IPSSMexample.csv test.csv)
echo "$OUTPUT"
# Check the stout for the expected output
EXPECTED="✅ Annotated file written to: test.csv\nFile annotated successfully."
if [ "$OUTPUT" = "$EXPECTED" ]; then
echo "Output matches expected"
else
echo "Output does not match expected"
exit 1
fi
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Node modules
node_modules

# Compiled JS files
dist

# Data test files
test/data/*-out.*
dist
test.csv

0 comments on commit d846955

Please sign in to comment.