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

Create tests for hslayers-server and convert CommonJS files to ES syntax #4654

Merged
merged 12 commits into from
Feb 5, 2024
Merged
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Node CI
name: Build & test hslayers, app & sensors

on: [push]
on:
push:
paths-ignore:
- 'projects/hslayers-server/**/*'

jobs:
build:
Expand All @@ -9,7 +12,7 @@ jobs:

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

steps:
- uses: actions/checkout@v3
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/build+test_server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build & test hslayers-server

on:
push:
paths:
- 'projects/hslayers-server/**/*'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 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 }}
- name: Change working directory
run: cd ./projects/hslayers-server/
- name: Install dependencies
run: npm ci --force
- name: Test
run: npm test
env:
CI: true
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"build-watch": "ng build hslayers --watch",
"find-circular": "npx madge --circular --extensions ts ./projects/hslayers/",
"test": "ng test hslayers",
"test-server": "cd ./projects/hslayers-server && npm test",
"lint": "eslint --ignore-path .gitignore --fix-dry-run ./",
"lint-stats": "eslint --ignore-path .gitignore --format node_modules/eslint-stats/byErrorAndWarning.js ./",
"e2e": "ng e2e",
Expand Down Expand Up @@ -153,4 +154,4 @@
"path": false,
"fs": false
}
}
}
31 changes: 31 additions & 0 deletions projects/hslayers-server/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"env": {
"browser": false,
"es6": true,
"node": true,
"mocha": true
},
"globals": {},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2020
},
"overrides": [
{
"files": [
"*.js"
],
"extends": [
"eslint:recommended"
]
},
{
"files": [
"**/*.spec.js"
],
"extends": [
"plugin:mocha/recommended"
]
}
]
}
6 changes: 6 additions & 0 deletions projects/hslayers-server/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
hslayers-server.db
data/
.env
.env.*
!.env.example
.eslintrc.json
Loading
Loading