You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Normally, I run my tests via vscode-test, but I am now trying to use vscode-extension-tester in my project and have been attempting to add the UI testing features to some existing tests. However, it seems like I'm not able to import the vscode module when I'm using vscode-extension-tester to run my test files. In order to verify this wasn't tied to my own project, I tried to use the module in the activityBar.test.ts file in the sample project:
import { expect } from 'chai';
import { ActivityBar } from 'vscode-extension-tester';
import * as vscode from 'vscode';
// sample tests using the Activity Bar (the left toolbar)
describe('Activity Bar Example Tests', () => {
let activityBar: ActivityBar;
before(async () => {
// init the activity bar page object
activityBar = new ActivityBar();
});
// Test what view controls are available
it('Shows explorer view control (container)', async () => {
const commands = vscode.commands.getCommands();
// get all the view controls
const controls = await activityBar.getViewControls();
...
I got back the following error:
Error: Cannot find module 'vscode'
This is exactly what I'm seeing in my own project. I was trying to figure out if the error was caused by my project setup, but it seems like it's more to do with using vscode-extension-tester. Is this a known issue? Is there something I would need to change about my project's configuration to allow for this kind of import to work?
EDIT:
Within my project, it also seems to have problems finding the vscode module outside of the test files, as well:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Normally, I run my tests via vscode-test, but I am now trying to use
vscode-extension-tester
in my project and have been attempting to add the UI testing features to some existing tests. However, it seems like I'm not able to import thevscode
module when I'm usingvscode-extension-tester
to run my test files. In order to verify this wasn't tied to my own project, I tried to use the module in theactivityBar.test.ts
file in the sample project:I got back the following error:
This is exactly what I'm seeing in my own project. I was trying to figure out if the error was caused by my project setup, but it seems like it's more to do with using
vscode-extension-tester
. Is this a known issue? Is there something I would need to change about my project's configuration to allow for this kind of import to work?EDIT:
Within my project, it also seems to have problems finding the
vscode
module outside of the test files, as well:Beta Was this translation helpful? Give feedback.
All reactions