Skip to content

Commit

Permalink
run unit tests in GH
Browse files Browse the repository at this point in the history
  • Loading branch information
jpogran committed Dec 8, 2021
1 parent df5624e commit 16c4eb5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,44 @@ jobs:
- name: lint
run: npm run lint

unit:
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- macos-latest
- ubuntu-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 3

steps:
- name: Checkout Repo
uses: actions/checkout@v2
-
name: Read Node.js version (Unix)
if: ${{ runner.os != 'Windows' }}
id: nodejs-version-unix
run: |
content=`cat ./.nvmrc`
echo "::set-output name=content::$content"
-
name: Read Node.js version (Windows)
if: ${{ runner.os == 'Windows' }}
id: nodejs-version-win
run: |
$content = Get-Content .\.nvmrc -Raw
echo "::set-output name=content::$content"
- name: Setup Node.js
uses: actions/setup-node@v1
with:
# See https://github.com/actions/setup-node/issues/32
node-version: ${{ steps.nodejs-version-unix.outputs.content || steps.nodejs-version-win.outputs.content }}
- name: npm install
run: npm ci
- name: unit test
run: npm run test:unit

test:
strategy:
matrix:
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@
"lint": "eslint src --ext ts",
"pretest": "npm run compile && npm run lint",
"test": "node ./out/test/runTest.js",
"test:unit": "jest",
"package": "vsce package",
"prettier": "prettier \"**/*.+(js|json|ts)\"",
"format": "npm run prettier -- --write",
Expand Down

0 comments on commit 16c4eb5

Please sign in to comment.