Skip to content
This repository was archived by the owner on May 11, 2022. It is now read-only.

Commit dc63454

Browse files
committed
FUSETOOLS2-1358 - use more specific activation event
- it allows to build with vsce without specific flag since they introduced yet again a blocking warning and supposedly improve performance - it requires to modify some tests that were using VS Code ExtnesionContext as attributes. At this time, the VS Code extension is no more started. it is started on the `before` mocha test lifecycle Signed-off-by: Aurélien Pupier <[email protected]>
1 parent c50b46b commit dc63454

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"Other"
3939
],
4040
"activationEvents": [
41-
"*",
41+
"onStartupFinished",
4242
"onWebviewPanel:didact"
4343
],
4444
"main": "./out/extension.js",

src/test/suite/didactUriCompletionItemProvider.test.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,13 @@ const testFileUri = vscode.Uri.file(testFilename);
4040

4141
suite("Didact URI completion provider tests", function () {
4242

43-
const ctx = getContext();
44-
const provider = new DidactUriCompletionItemProvider(ctx);
43+
let ctx : vscode.ExtensionContext;
44+
let provider: DidactUriCompletionItemProvider;
45+
46+
this.beforeAll(() => {
47+
ctx = getContext();
48+
provider = new DidactUriCompletionItemProvider(ctx);
49+
});
4550

4651
test("that all commands in the didactCompletionCatalog.json are available", async () => {
4752
const catalog : any = provider.getCompletionCatalog(ctx);

src/test/suite/nodeProvider.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727
suite('Node provider test suite', () => {
2828
const tutorialName = 'HelloWorld with JavaScript in Three Steps';
2929
const tutorialCategory = 'Didact';
30-
const tutorialUri = vscode.Uri.file(getContext().asAbsolutePath('./demos/markdown/helloJS/helloJS.didact.md'));
30+
let tutorialUri: vscode.Uri;
3131
const headingName = 'Step 2: Create Our First JavaScript project';
32-
33-
before('set up the registry tests', async () => {
32+
33+
before('set up the registry tests and initialize tutorialUri', async () => {
34+
tutorialUri = vscode.Uri.file(getContext().asAbsolutePath('./demos/markdown/helloJS/helloJS.didact.md'));
3435
// make sure that the HelloWorld tutorial is registered if it's been cleared
3536
await registerTutorialWithCategory(tutorialName, tutorialUri.fsPath, tutorialCategory, true);
3637
});

0 commit comments

Comments
 (0)