Skip to content

test: add VSCode extension testing (#22)#23

Open
newtontech wants to merge 1 commit into
masterfrom
feat/add-testing
Open

test: add VSCode extension testing (#22)#23
newtontech wants to merge 1 commit into
masterfrom
feat/add-testing

Conversation

@newtontech
Copy link
Copy Markdown
Owner

Summary

This PR adds comprehensive VSCode extension testing infrastructure as requested in issue #22.

Changes

Test Files Added

  • src/test/suite/extension.test.ts - Comprehensive test suite with 21 test cases

Tests Implemented

  1. Extension Activation Tests

    • Extension presence verification
    • Extension activation verification
    • Sidebar context setting verification
  2. Command Registration Tests (21 commands total)

    • openqc.visualizeStructure
    • openqc.plotData
    • openqc.previewInput
    • openqc.startLSP
    • openqc.stopLSP
    • openqc.restartLSP
    • openqc.validate
    • openqc.sidebar.refreshMolecules
    • openqc.sidebar.refreshJobs
    • openqc.sidebar.openMolecule
    • openqc.sidebar.deleteMolecule
    • openqc.sidebar.runCalculation
    • openqc.sidebar.viewResults
    • openqc.sidebar.exportData
    • openqc.sidebar.cancelJob
    • openqc.sidebar.restartJob
    • openqc.convertFormat
    • openqc.convertToXYZ
    • openqc.convertToPDB
    • openqc.convertToVASP
    • openqc.convertToGaussian
    • openqc.batchConvert
    • openqc.checkConverterBackend

Dependencies

  • Added mocha@^10.7.3 to devDependencies for test runner

Test Framework

  • Uses existing @vscode/test-electron framework
  • Follows VSCode extension testing best practices
  • Tests run in TDD mode with Mocha

Testing

The test suite can be run with:

npm run test:e2e

Checklist

  • Test files created in src/test/suite/
  • Extension activation tests implemented
  • Command registration tests implemented
  • Dependencies added to package.json
  • Code follows project conventions
  • Commit message follows conventional commits

Fixes #22

- Add extension.test.ts with comprehensive test suite
- Test extension activation and presence
- Test all registered commands (21 commands total)
- Add mocha as devDependency for test runner
- Follows VSCode extension testing best practices

Fixes #22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Testing] 添加 VSCode 扩展测试

1 participant