Skip to content

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

Closed
microsoft/vscode-js-debug
#1941

Description

@TylerLeonhardt

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.

Activity

  1. added this to the milestone on Dec 14, 2023
  2. added
    feature-request
    debug
    on Dec 14, 2023
  3. modified the milestones: , February 2024 on Jan 19, 2024
  4. added
    verification-needed
    on Feb 18, 2024
  5. added
    verification-steps-needed
    on Feb 20, 2024
  6. removed
    verification-steps-needed
    on Feb 21, 2024
  7. connor4312 commented on Feb 21, 2024

    @connor4312
    Member

    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

  8. karthiknadig commented on Feb 21, 2024

    @karthiknadig
    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

  9. added
    verification-found
    on Feb 21, 2024
  10. TylerLeonhardt commented on Feb 21, 2024

    @TylerLeonhardt
    MemberAuthor

    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.

  11. TylerLeonhardt commented on Feb 21, 2024

    @TylerLeonhardt
    MemberAuthor

    Karthik Nadig (@karthiknadig) you need the nightly js debug or wait til tomorrow's insiders

  12. added
    verified
    on Feb 22, 2024
  13. locked and limited conversation to collaborators on Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

debugfeature-requestverification-neededverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions