Skip to content

Commit b550089

Browse files
test: add interactive CLI tests (#264)
* test: add interactive CLI tests * ci: run CLI tests in CI
1 parent a764bee commit b550089

File tree

9 files changed

+674
-30
lines changed

9 files changed

+674
-30
lines changed

.github/workflows/cli-pr-checks.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
name: CLI PR checks
2-
description: check the CLI PR
3-
42
on:
53
pull_request:
64
paths: ['cli/**']
@@ -10,7 +8,7 @@ concurrency:
108
cancel-in-progress: true
119

1210
jobs:
13-
check-code:
11+
test:
1412
runs-on: ubuntu-latest
1513

1614
steps:
@@ -19,7 +17,7 @@ jobs:
1917
- name: Setup Node.js
2018
uses: actions/setup-node@v4
2119
with:
22-
node-version: '20'
20+
node-version: '22'
2321
cache: 'npm'
2422
cache-dependency-path: 'cli/npm-shrinkwrap.json'
2523

@@ -39,12 +37,17 @@ jobs:
3937
working-directory: cli
4038
run: npm run lint
4139

42-
- name: Test no crash
40+
- name: Install iapp cli
4341
working-directory: cli
4442
run: |
4543
npm i -g .
4644
iapp -h
4745
46+
- name: Test
47+
working-directory: cli
48+
run: |
49+
npm run test
50+
4851
npm-dry-run:
4952
uses: ./.github/workflows/reusable-cli-npm.yml
5053
with:

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ api/.env
55
api/sig
66
.tags
77

8-
cli/dist
8+
cli/dist
9+
cli/test/out

cli/npm-shrinkwrap.json

Lines changed: 195 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
"build:watch": "npm run build -- --watch",
1414
"check-format": "prettier --check .",
1515
"format": "prettier --write .",
16-
"lint": "eslint src"
16+
"lint": "eslint src",
17+
"test:pre": "echo 'testing' && which iapp || (echo 'iapp CLI is not installed' && exit 1)",
18+
"test": "npm run test:pre && node --test test/**/*.test.ts"
1719
},
1820
"author": "iExec",
1921
"license": "Apache-2.0",
@@ -60,9 +62,11 @@
6062
"@types/debug": "^4.1.12",
6163
"@types/dockerode": "^3.3.37",
6264
"@types/figlet": "^1.7.0",
65+
"@types/node": "^25.0.3",
6366
"@types/prompts": "^2.4.9",
6467
"@types/ws": "^8.18.1",
6568
"@types/yargs": "^17.0.33",
69+
"cli-testing-library": "^3.0.1",
6670
"eslint": "^9.24.0",
6771
"eslint-plugin-unicorn": "^58.0.0",
6872
"globals": "^16.0.0",

0 commit comments

Comments
 (0)