Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat testing #72

Merged
merged 37 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
866402f
chore: update .gitignore to include .env.local, .cursorrules, and docs/
joshmu Dec 25, 2024
a30cf2e
chore: update dependencies and add initial setup unit tests for confi…
joshmu Dec 25, 2024
56b5d71
test: enhance unit tests for Periscope activation and search function…
joshmu Dec 25, 2024
d356e24
chore: remove unecessary config type
joshmu Dec 26, 2024
493f5dd
fix: correct async support for openInHorizontalSplit
joshmu Dec 26, 2024
ebb992e
test: enhance QuickPick UI tests with comprehensive mocks and assertions
joshmu Dec 26, 2024
083c0d2
test: quickpick tests
joshmu Dec 26, 2024
714c07a
refactor: improve query flag extraction in checkAndExtractRgFlagsFrom…
joshmu Dec 26, 2024
64fa057
test: update glob pattern extraction test in ripgrep integration
joshmu Dec 26, 2024
99e0abe
test: enhance QuickPick UI tests with native search integration
joshmu Dec 26, 2024
2db4e86
test: add QuickPick menu actions navigation test
joshmu Dec 26, 2024
21efccb
test: add handling for previous results in QuickPick UI
joshmu Dec 26, 2024
ddc6c06
test: add selection handling for QuickPick search results
joshmu Dec 26, 2024
fbfee83
test: add unit tests for formatPathLabel utility
joshmu Dec 26, 2024
7fbdead
test: update root path handling in formatPathLabel tests
joshmu Dec 26, 2024
6064827
test: add edge case handling for formatPathLabel function
joshmu Dec 26, 2024
9d438d5
test: add comprehensive formatting tests for QuickPick items
joshmu Dec 26, 2024
f8a5c23
test: add basic preview content generation test for quickpick ui
joshmu Dec 26, 2024
e497018
test: add advanced preview content test with syntax highlighting
joshmu Dec 26, 2024
e3a784a
test: add preview content scrolling and navigation test
joshmu Dec 26, 2024
d40f68a
test: implement default settings validation test
joshmu Dec 26, 2024
373053f
test(config): add custom ripgrep options test
joshmu Dec 26, 2024
df01ba3
refactor(tests): remove obsolete configuration tests
joshmu Dec 26, 2024
3c5d71f
test(quickPick): enhance QuickPick UI tests with improved mock setups…
joshmu Dec 26, 2024
db167eb
test: configure environment for testing and enhance logging behavior
joshmu Dec 26, 2024
7db7c4d
chore: add testing workflow and enforce test dependency for releases
joshmu Dec 26, 2024
eda0efc
test(formatPathLabel): improve workspace folder handling tests
joshmu Dec 26, 2024
f61507a
test(formatPathLabel): enhance path handling tests with platform-inde…
joshmu Dec 26, 2024
f07d4a0
test(formatPathLabel): remove redundant edge case test for empty path
joshmu Dec 26, 2024
5ea691d
chore: update configuration and improve code formatting
joshmu Dec 26, 2024
1aecbd6
test(formatPathLabel): enhance path handling with normalization utility
joshmu Dec 26, 2024
c77d9e0
refactor(ripgrep): streamline ripgrep path resolution and enhance tests
joshmu Dec 27, 2024
04d1ad3
fix: update ripgrep path handling and improve query extraction logic
joshmu Dec 27, 2024
8e7daf7
refactor(tests): remove obsolete extension test and streamline perisc…
joshmu Dec 27, 2024
f1aca26
refactor(tests): simplify ripgrep tests and enhance path resolution c…
joshmu Dec 27, 2024
718a726
test(quickPick): enhance search result formatting and mock process ha…
joshmu Dec 27, 2024
d73f77c
test(quickPick): refactor search result formatting and mock process h…
joshmu Dec 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 49 additions & 21 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,62 @@
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": true,
"tsconfigRootDir": "."
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"extends": ["airbnb-base", "plugin:@typescript-eslint/recommended", "prettier"],
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"],
"moduleDirectory": ["node_modules", "src/"]
}
}
},
"rules": {
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "default",
"format": ["camelCase"],
"filter": {
"regex": "^_type$",
"match": false
}
},
{
"selector": "variable",
"format": ["camelCase", "UPPER_CASE"]
},
{
"selector": "parameter",
"format": ["camelCase"],
"leadingUnderscore": "allow"
},
{
"selector": "memberLike",
"modifiers": ["private"],
"format": ["camelCase"],
"leadingUnderscore": "require"
},
{
"selector": "typeLike",
"format": ["PascalCase"]
},
{
"selector": "property",
"format": null,
"filter": {
"regex": "^_type$",
"match": true
}
},
{
"selector": "objectLiteralProperty",
"format": ["camelCase", "UPPER_CASE"],
"filter": {
"regex": "^(NODE_ENV|VSCODE_TEST)$",
"match": true
}
}
],
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"import/prefer-default-export": "off",
"import/extensions": "off",
"import/no-unresolved": "off",
"max-len": ["warn", { "code": 120 }],
"no-console": "off",
"import/no-extraneous-dependencies": "off",
"no-use-before-define": "off",
"no-param-reassign": "off",
"no-underscore-dangle": "off"
"semi": "off"
},
"ignorePatterns": ["out", "dist", "**/*.d.ts"]
}
5 changes: 5 additions & 0 deletions .github/workflows/publish-vscode-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ on:
- master

jobs:
# Add test job dependency
test:
uses: ./.github/workflows/test.yml

semantic-release:
needs: test # Require tests to pass before release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Tests

on:
push:
branches: [main, master]
pull_request:
types: [opened, synchronize, reopened]
branches: [main, master]
# Add workflow_call to allow other workflows to depend on this
workflow_call:

jobs:
test:
name: Test (${{ matrix.os }})
strategy:
# Keep fail-fast true to ensure all tests must pass
fail-fast: true
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
node-version: [20.x]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Format code before testing
- name: Format Code
run: npm run lint:fix

# Linux requires xvfb to run vscode tests
- name: Install xvfb (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb
# Run tests based on platform
- name: Run Tests (Linux)
if: runner.os == 'Linux'
run: xvfb-run -a npm test

- name: Run Tests (macOS/Windows)
if: runner.os != 'Linux'
run: npm test

# Report test status on PR
- name: Update PR Status
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const { owner, repo, number } = context.issue;
const jobName = process.env.MATRIX_OS;
github.rest.issues.createComment({
owner,
repo,
issue_number: number,
body: `✅ Tests passed on ${jobName}`
});
env:
MATRIX_OS: ${{ matrix.os }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ dist
node_modules
.vscode-test/
*.vsix
.env.local
.env.local
.cursorrules
.clinerules
docs/
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"endOfLine": "lf",
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"tabWidth": 2,
"printWidth": 120
"printWidth": 100
}
Loading
Loading