Skip to content

Commit

Permalink
fix: add local tests (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
shazron authored Aug 2, 2023
1 parent aad1832 commit 9673a3f
Show file tree
Hide file tree
Showing 16 changed files with 12,219 additions and 3,549 deletions.
3 changes: 0 additions & 3 deletions .eslintrc

This file was deleted.

11 changes: 11 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "@adobe/eslint-config-aio-lib-config",
"settings": {
"jsdoc": {
"ignorePrivate": true
}
},
"parserOptions": {
"ecmaVersion": "latest"
}
}
4 changes: 0 additions & 4 deletions .github/workflows/app-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ on:
schedule:
# run daily at midnight
- cron: '0 0 * * *'
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [16.x]
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm i --package-lock --package-lock-only
- run: npm ci
- run: npm run build --if-present
- run: npm test
- name: upload coverage
if: success()
uses: codecov/[email protected]
with:
name: ${{ runner.os }} node.js ${{ matrix.node-version }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ playground
env.key
env.key.enc

.parcel-cache
.parcel-cache
coverage
33 changes: 33 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
Copyright 2023 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

module.exports = {
testEnvironment: 'node',
verbose: true,
setupFilesAfterEnv: ['./test/jest.setup.js'],
collectCoverage: true,
testPathIgnorePatterns: [
'<rootDir>/src/*'
],
collectCoverageFrom: [
'src/**/*.js',
'!src/index.js'
],
coverageThreshold: {
global: {
branches: 100,
lines: 100,
statements: 100,
functions: 100
}
}
}
Loading

0 comments on commit 9673a3f

Please sign in to comment.