-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fix/manifest-corruption-prevention
- Loading branch information
Showing
52 changed files
with
12,576 additions
and
4,467 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [ "*" ] | ||
pull_request: | ||
branches: [ "*" ] | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
cache: 'npm' | ||
cache-dependency-path: | | ||
package-lock.json | ||
new_lineage_panel/package-lock.json | ||
webview_panels/package-lock.json | ||
- name: Install dependencies | ||
run: | | ||
npm ci | ||
npm run install:panels | ||
- name: Compile | ||
run: npm run compile | ||
|
||
- name: Install xvfb | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y xvfb | ||
- name: Run tests (Linux) | ||
if: runner.os == 'Linux' | ||
run: | | ||
xvfb-run --auto-servernum npm run compile && xvfb-run --auto-servernum npm run test:coverage | ||
- name: Run tests (macOS/Windows) | ||
if: runner.os != 'Linux' | ||
run: | | ||
npm run compile && npm run test:coverage | ||
- name: Upload test results | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-results-${{ matrix.os }} | ||
path: test-results/ | ||
|
||
- name: Upload coverage results | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage-${{ matrix.os }} | ||
path: | | ||
coverage/ | ||
.nyc_output/ | ||
*.lcov | ||
- name: Upload coverage to Codecov | ||
if: always() | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
directory: ./coverage/ | ||
flags: unittests | ||
name: codecov-${{ matrix.os }} | ||
fail_ci_if_error: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"extends": "@istanbuljs/nyc-config-typescript", | ||
"all": true, | ||
"check-coverage": true, | ||
"reporter": ["text", "lcov"], | ||
"exclude": [ | ||
"coverage/**", | ||
"packages/*/test/**", | ||
"test/**", | ||
"test{,-*}.{js,cjs,mjs,ts}", | ||
"**/*{.,-}test.{js,cjs,mjs,ts}", | ||
"**/__tests__/**", | ||
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress}.config.{js,cjs,mjs,ts}", | ||
"**/node_modules/**", | ||
"dist/**", | ||
"out/**", | ||
"src/test/**", | ||
"src/**/*.test.ts", | ||
"src/test/suite/**" | ||
], | ||
"include": ["src/**/*.ts"], | ||
"branches": 5, | ||
"lines": 7, | ||
"functions": 7, | ||
"statements": 7 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
coverage: | ||
status: | ||
project: | ||
default: | ||
target: 10% # the required coverage value | ||
threshold: 1% # the leniency in hitting the target | ||
patch: | ||
default: | ||
target: 90% | ||
threshold: 1% | ||
|
||
ignore: | ||
- "test/**/*" # ignore test files | ||
- "out/**/*" # ignore compiled output | ||
- "**/*.d.ts" # ignore type declaration files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = { | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
roots: ["<rootDir>/src"], | ||
testMatch: ["**/*.test.ts"], | ||
transform: { | ||
"^.+\\.tsx?$": ["ts-jest", { tsconfig: "tsconfig.json" }], | ||
}, | ||
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"], | ||
setupFilesAfterEnv: ["<rootDir>/src/test/setup.ts"], | ||
collectCoverageFrom: [ | ||
"src/**/*.{ts,tsx}", | ||
"!src/test/**", | ||
"!**/node_modules/**", | ||
], | ||
coverageDirectory: "coverage", | ||
moduleNameMapper: { | ||
"^vscode$": "<rootDir>/src/test/mock/vscode.ts", | ||
"^@lib$": "<rootDir>/src/test/mock/lib.ts", | ||
}, | ||
}; |
Oops, something went wrong.