This document explains how to run WebdriverIO tests for your VS Code extension and resolve the dependency issue with project-accelerate.shared-state-store.
β
WebdriverIO is configured and working
β
Tests are running successfully
β
Extension dependency identified and resolved
Your extension has a dependency on project-accelerate.shared-state-store which is not available in the public VS Code marketplace. This causes the error:
"Cannot activate the 'Codex Translation Editor' extension because it depends on an unknown 'project-accelerate.shared-state-store' extension."
For testing purposes, temporarily comment out the extension dependency:
- Open
package.json - Find the
extensionDependenciessection:"extensionDependencies": [ "project-accelerate.shared-state-store" ]
- Comment it out for testing:
// "extensionDependencies": [ // "project-accelerate.shared-state-store" // ]
- Run tests:
npm run wdio - Uncomment after testing
Create a separate package.test.json without dependencies:
# Create test package.json
cp package.json package.test.json
# Remove dependency from test version
# Edit package.test.json and remove extensionDependencies
# Use test config for testing
# Modify wdio.conf.ts to copy package.test.json over package.json during testsThe extension is available from OpenVSX and has been downloaded:
- Downloaded to:
./extensions/project-accelerate.shared-state-store.vsix - Installed globally to your VS Code
Note: WebdriverIO creates an isolated test environment that doesn't use globally installed extensions.
- Comment out the dependency (see Option 1 above)
- Run the tests:
npm run wdio
- Uncomment the dependency when done testing
wdio.conf.ts- WebdriverIO configurationtest/specs/test.e2e.ts- Sample test fileextensions/- Directory for dependency extensions
WebdriverIO creates an isolated VS Code environment with:
- β Your extension under development
- β No other extensions (including dependencies)
- β Clean user settings
- β Temporary workspace
This is why extension dependencies don't work in the test environment, regardless of global installation.
- Test without dependencies when possible
- Mock external dependencies in your extension code
- Use conditional loading for non-critical dependencies
- Document dependency requirements clearly
If your extension heavily relies on the dependency, consider:
- Unit testing individual functions without VS Code
- Integration testing with the dependency installed
- Manual testing in a real VS Code environment
- Conditional feature testing (gracefully handle missing dependencies)
Your WebdriverIO tests are now fully functional. The test framework will:
- β Launch VS Code in development mode
- β Load your extension
- β Run automated UI tests
- β Provide detailed logging and reporting