Skip to content

Commit

Permalink
Add unit tests for webviews react components (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
neehar18 authored Oct 31, 2024
1 parent c29890c commit 8c3de83
Show file tree
Hide file tree
Showing 12 changed files with 7,339 additions and 564 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ jobs:
npm test
fi
# Run unit tests for react components
- name: Run Webview Tests
run: npm run test:jest

# Update latest release (only on Linux and for the main branch)
- name: Update latest release
if: runner.os == 'Linux' && github.ref == 'refs/heads/main'
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
"pretest": "npm run compile-tests && npm run compile && npm run lint",
"check-types": "tsc --noEmit",
"lint": "eslint src --ext ts",
"test": "vscode-test"
"test": "vscode-test",
"test:jest": "cd webviews && npm run test"
},
"devDependencies": {
"@types/mocha": "^10.0.9",
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
],
"sourceMap": true,
"rootDir": "src",
"jsx": "react",
"esModuleInterop": true,
"strict": true /* enable all strict type-checking options */
/* Additional Checks */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
Expand Down
1 change: 1 addition & 0 deletions webviews/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@testing-library/jest-dom';
Loading

0 comments on commit 8c3de83

Please sign in to comment.