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
Probably this is not an issue, but a lack of understanding from my side. However, I am unable to get it working. My goal is to add e2e tests to the web version of https://github.com/foambubble/foam/.
I've replicated the setup of the sample project, but I am getting the following error:
Activating extension 'vscode.vscode-test-web-fs' failed: Extension 'vscode.vscode-test-web-fs' CANNOT use API proposal: fileSearchProvider.
Its package.json#enabledApiProposals-property declares: but NOT fileSearchProvider.
The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api vscode.vscode-test-web-fs.
My test runner is:
import*aspathfrom'path';import{runTests}from'@vscode/test-web';asyncfunctionmain(){try{// The folder containing the Extension Manifest package.jsonconstextensionDevelopmentPath=path.resolve(__dirname,'..');// The path to module with the test runner and testsconstextensionTestsPath=path.resolve(__dirname,'./web/index');constfolderPath=path.resolve(__dirname,'./../../.test-workspace');constattachArgName='--waitForDebugger=';constwaitForDebugger=process.argv.find(arg=>arg.startsWith(attachArgName));// Start a web server that serves VSCode in a browser, run the testsawaitrunTests({browserType: 'chromium',
extensionDevelopmentPath,
extensionTestsPath,
folderPath,verbose: true,waitForDebugger: waitForDebugger
? Number(waitForDebugger.slice(attachArgName.length))
: undefined,});}catch(err){console.error('Failed to run tests');process.exit(1);}}main();
My suite looks like:
/*global mocha:readonly*//*global __WebpackModuleApi:readonly*/// Imports mocha for the browser, defining the `mocha` global.require('mocha/mocha');exportfunctionrun(): Promise<void>{console.log('Enter run');returnnewPromise((c,e)=>{mocha.setup({ui: 'tdd',reporter: undefined,});// Bundles all files in the current directory matching `*.test`constimportAll=(r: __WebpackModuleApi.RequireContext)=>r.keys().forEach(r);importAll(require.context('.',true,/\.webtest$/));try{console.log('Running test////');// Run the mocha testmocha.run(failures=>{console.log(failures);if(failures>0){e(newError(`${failures} tests failed.`));}else{c();}});}catch(err){console.error(err);e(err);}});}
And I am using webpack and tsc config similar to the sample project. Eventually, I run the test suite with the following run script:
Thanks for thinking along! Based on your repository, I've kept fiddling around. I've got it working and learned two things.
I had some issues in my test runner, pointing to the incorrect directories. In my case, I pointed to the src folder and not the folder containing package.json.
For the open-in-browser command, I got it working by not starting the browsers pointing to a workspace. So boot up blank and open the same folder manually. This won't cause the activation problem to occur. Not sure what the cause is.
I am good for now, but not sure if this should be the correct behaviour. Could it be caused by the monorepo structure of foam?
Hi,
Probably this is not an issue, but a lack of understanding from my side. However, I am unable to get it working. My goal is to add e2e tests to the web version of https://github.com/foambubble/foam/.
I've replicated the setup of the sample project, but I am getting the following error:
My test runner is:
My suite looks like:
And I am using webpack and tsc config similar to the sample project. Eventually, I run the test suite with the following run script:
I am lost how to solve this. Any suggestions are welcome.
The text was updated successfully, but these errors were encountered: