Skip to content

Commit

Permalink
Merge pull request #14 from NREL/issue-6-GH-testing
Browse files Browse the repository at this point in the history
- Automated testing using Github Actions, angular tests, on linux.
  • Loading branch information
jordanperr authored Nov 6, 2023
2 parents e015402 + 3d82989 commit 6e743b4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI Testing On PR into Develop Branch

on:
pull_request:
branches: [ "develop" ]

jobs:
ubuntu-build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm run build --if-present
- run: npm run test-ci
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ This project was generated with [Angular CLI](https://github.com/angular/angular

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

Karma unit tests use Google Chrome as a default browser. This will need to be installed on your machine for the tests to run. Otherwise you can check the documentation on how to target other browsers using a config file: [Karma Config](https://karma-runner.github.io/6.4/config/configuration-file.html)
Karma unit tests use Google Chrome as a default browser. This will need to be installed on your machine for the tests to run using `ng test` or `npm run test`.

Otherwise, you can run the tests with a headless version of chrome using `ng test --browsers=ChromeHeadless` or `npm run test-ci`

## Further help

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"build-watch": "ng build --base-href . --watch",
"electron": "electron .",
"dist": "electron-builder",
"test": "ng test"
"test": "ng test",
"test-ci": "ng test --no-watch --no-progress --browsers=ChromeHeadless"
},
"private": true,
"build": {
Expand Down

0 comments on commit 6e743b4

Please sign in to comment.