Skip to content

Commit

Permalink
Merge pull request geostyler#570 from KaiVolland/typeguard-tests
Browse files Browse the repository at this point in the history
Add tests for the typeguards
  • Loading branch information
KaiVolland committed May 11, 2023
2 parents d7d3e6b + cb022a9 commit fa9baee
Show file tree
Hide file tree
Showing 11 changed files with 15,956 additions and 6,243 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/on-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Use Node.js 14.x
- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 18.x

- name: Cache Node.js modules 💾
uses: actions/cache@v2
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [14.x, 16.x, 18.x]

steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
Expand All @@ -34,5 +34,8 @@ jobs:
- name: Lint code 💄
run: npm run lint

- name: Test code ✅
run: npm run test

- name: Build artifacts 🏗️
run: npm run build
15 changes: 9 additions & 6 deletions .github/workflows/on-push-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js 14.x
- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 18.x

- name: Cache Node.js modules 💾
uses: actions/cache@v2
Expand All @@ -33,17 +33,20 @@ jobs:
- name: Lint code 💄
run: npm run lint

- name: Test code ✅
run: npm run test

build_docs:
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js 14.x
- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 18.x

- name: Cache Node.js modules 💾
uses: actions/cache@v2
Expand Down
9 changes: 9 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
'presets': [
'@babel/env',
'@babel/preset-typescript'
],
'plugins': [
'@babel/proposal-object-rest-spread'
]
};
16 changes: 8 additions & 8 deletions examples/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ const pointSimplePoint: Style = {
],
name: 'Small populated New Yorks',
scaleDenominator: {
'max': 20000,
'min': 10000
max: 20000,
min: 10000
},
symbolizers: [{
'kind': 'Mark',
'wellKnownName': 'circle',
'color': '#FF0000',
'radius': 3,
'strokeColor': '#000000',
'strokeWidth': 2
kind: 'Mark',
wellKnownName: 'circle',
color: '#FF0000',
radius: 3,
strokeColor: '#000000',
strokeWidth: 2
}]
}]
};
Expand Down
15 changes: 15 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
collectCoverageFrom: [
'<rootDir>/test/typeguards.ts'
],
testMatch: [
'<rootDir>/test/typeguards.spec.ts'
],
transform: {
'^.+\\.ts': '<rootDir>/node_modules/babel-jest'
},
moduleFileExtensions: [
'ts',
'js'
]
};

0 comments on commit fa9baee

Please sign in to comment.