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

extensionHost launch config should support .vscode-test.js files natively #199211

Closed
TylerLeonhardt opened this issue Nov 27, 2023 · 4 comments · Fixed by microsoft/vscode-js-debug#1941
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@TylerLeonhardt
Copy link
Member

The new .vscode-test.js format and test runner are awesome, but some folks still like to use the regular ol' extensionHost launch config to run & debug tests.

We should support this new way in the launch config as well so that we don't have to implement our own runner in order to do this.

@connor4312 connor4312 added this to the December / January 2024 milestone Dec 14, 2023
@connor4312 connor4312 added feature-request Request for new features or functionality debug Debug viewlet, configurations, breakpoints, adapter issues labels Dec 14, 2023
@connor4312 connor4312 modified the milestones: December / January 2024, February 2024 Jan 19, 2024
connor4312 added a commit to microsoft/vscode-js-debug that referenced this issue Feb 8, 2024
connor4312 added a commit to microsoft/vscode-js-debug that referenced this issue Feb 9, 2024
@connor4312 connor4312 added the verification-needed Verification of issue is requested label Feb 18, 2024
@Tyriar Tyriar added the verification-steps-needed Steps to verify are needed for verification label Feb 20, 2024
@connor4312 connor4312 removed the verification-steps-needed Steps to verify are needed for verification label Feb 21, 2024
@connor4312
Copy link
Member

connor4312 commented Feb 21, 2024

You should be able to reference a test config file using this format in your launch.json:

{
	"type": "extensionHost",
	"request": "launch",
	"name": "My extension tests",
	"testConfiguration": "${workspaceFolder}/.vscode-test.js",
},

The sample works: https://github.com/microsoft/vscode-extension-samples/tree/main/helloworld-test-cli-sample

@karthiknadig
Copy link
Member

It does not seem to pick up:
image

Version: 1.87.0-insider (system setup)
Commit: ee69e28
Date: 2024-02-21T05:47:47.750Z
Electron: 27.3.2
ElectronBuildId: 26836302
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Windows_NT x64 10.0.22621

@TylerLeonhardt TylerLeonhardt added the verification-found Issue verification failed label Feb 21, 2024
@TylerLeonhardt
Copy link
Member Author

TylerLeonhardt commented Feb 21, 2024

Not sure if this is a verification found but the args in our mjs are not being applied:

part of mjs:

export default defineConfig({
	files: __dirname + '/dist/test-extension.js',
	version: 'insiders',
	launchArgs: [
		'--disable-extensions',
		'--user-data-dir=' + tempdir,
	],
	mocha: {
		ui: 'tdd',
		color: true,
		forbidOnly: !!process.env.CI,
		timeout: 5000
	}
});

config:

		{
			"name": "Extension tests",
			"type": "extensionHost",
			"request": "launch",
			"testConfiguration": "${workspaceFolder}/.vscode-test.mjs",
			"sourceMaps": true,
			"smartStep": true,
			"internalConsoleOptions": "openOnSessionStart",
			"outFiles": [
				"${workspaceFolder}/dist/**/*.js",
				"!**/node_modules/**"
			],
		},

Let me know if you need more details. This is a private repo FYI.

@TylerLeonhardt
Copy link
Member Author

TylerLeonhardt commented Feb 21, 2024

@karthiknadig you need the nightly js debug or wait til tomorrow's insiders

connor4312 added a commit to microsoft/vscode-js-debug that referenced this issue Feb 21, 2024
connor4312 added a commit to microsoft/vscode-js-debug that referenced this issue Feb 21, 2024
@connor4312 connor4312 removed the verification-found Issue verification failed label Feb 21, 2024
@TylerLeonhardt TylerLeonhardt added the verified Verification succeeded label Feb 22, 2024
@microsoft microsoft locked and limited conversation to collaborators Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants