Skip to content

Commit

Permalink
Merge branch 'dev' into feature/powershell-snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
Millicent Achieng committed Nov 30, 2021
2 parents 337d1b2 + c79d4ab commit 61de5ac
Show file tree
Hide file tree
Showing 49 changed files with 347,876 additions and 8,344 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ module.exports = {
'no-multiple-empty-lines': 'error',
'no-new-wrappers': 'error',
'quotes': ['error', 'single'],
'no-shadow': [
'no-shadow': 'off',
'@typescript-eslint/no-shadow': [
'warn',
{
hoist: 'all',
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
interval: monthly
open-pull-requests-limit: 10
33 changes: 32 additions & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
name: Lint and Build

on:
push
workflow_dispatch:
push:
branches:
- master
- dev
pull_request:
types: [opened, synchronize, reopened]

env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

jobs:
code-linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of results

- name: Install Nodejs
uses: actions/setup-node@v2
Expand All @@ -19,3 +30,23 @@ jobs:

- name: Run linter
run: npm run lint

- name: Run the tests
run: npm test

- name: Build
run: npm run build

- name: Generate test coverage report
run: npm run test -- --coverage --watchAll=false --testResultsProcessor=jest-sonar-reporter

- name: Fix code coverage paths
run: |
sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage/lcov.info
sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' reports/test-report.xml
- name: Run sonar cloud analysis
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

# testing
/coverage
/reports

# misc
.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
"typescript",
"typescriptreact"
],
}
}
21 changes: 11 additions & 10 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
module.exports = {
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}', '!src/**/*.d.ts'],
collectCoverageFrom: [
'src/**/*.{js,jsx,ts,tsx}',
'!**/node_modules/**',
'!build/**',
'!src/**/*.d.ts'
],
resolver: 'jest-pnp-resolver',
setupFiles: ['react-app-polyfill/jsdom'],
setupTestFrameworkScriptFile: '<rootDir>/src/setupTests.ts',
testMatch: [
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/**/?(*.)(spec|test).{js,jsx,ts,tsx}'
],
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'],
testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
globals: {
crypto: require('crypto')
},
testEnvironment: 'jsdom',
testURL: 'http://localhost',
transform: {
'^.+\\.(js|jsx|ts|tsx)$': '<rootDir>/node_modules/ts-jest/preprocessor.js',
'^.+\\.(js|jsx|ts|tsx)$': 'ts-jest',
'^.+\\.css$': '<rootDir>/config/jest/cssTransform.js',
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)':
'<rootDir>/node_modules/ts-jest/preprocessor.js'
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)':'ts-jest'
},
transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$',
Expand All @@ -42,5 +43,5 @@ module.exports = {
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname'
],
testResultsProcessor: './node_modules/jest-junit-reporter'
testResultsProcessor: 'jest-sonar-reporter'
};
Loading

0 comments on commit 61de5ac

Please sign in to comment.