Skip to content

Commit 7fa698f

Browse files
Merge pull request #173 to Update test launch configuration
2 parents 4fe630f + 52af517 commit 7fa698f

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

.vscode/launch.json

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,35 @@
77
"type": "extensionHost",
88
"request": "launch",
99
"runtimeExecutable": "${execPath}",
10-
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
10+
"args": [
11+
"--extensionDevelopmentPath=${workspaceFolder}"
12+
],
1113
"stopOnEntry": false,
1214
"sourceMaps": true,
13-
"outFiles": [ "${workspaceRoot}/out/src/**/*.js" ],
15+
"outFiles": [
16+
"${workspaceFolder}/out/src/**/*.js"
17+
],
1418
"preLaunchTask": "npm"
1519
},
1620
{
1721
"name": "Launch Tests",
1822
"type": "extensionHost",
1923
"request": "launch",
2024
"runtimeExecutable": "${execPath}",
21-
"args": ["test/resources/sample.f90","--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ],
25+
"env": {
26+
"CODE_TESTS_WORKSPACE": "./"
27+
},
28+
"args": [
29+
"test/resources/sample.f90",
30+
"--disable-extensions",
31+
"--extensionDevelopmentPath=${workspaceFolder}",
32+
"--extensionTestsPath=${workspaceFolder}/out/test"
33+
],
2234
"stopOnEntry": false,
2335
"sourceMaps": true,
24-
"outFiles": [ "${workspaceRoot}/out/test/**/*.js" ],
25-
"preLaunchTask": "npm"
36+
"outFiles": [
37+
"${workspaceFolder}/out/test/**/*.js"
38+
]
2639
}
2740
]
28-
}
41+
}

test/extension.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55

66
// The module 'assert' provides assertion methods from node
77
import * as assert from "assert";
8-
import * as fs from "fs";
98

109
// You can import and use all API from the 'vscode' module
1110
// as well as import your extension to test it
1211
import * as vscode from "vscode";
13-
import * as myExtension from "../src/extension";
12+
import * as path from 'path';
1413
import { FortranDocumentSymbolProvider } from "../src/features/document-symbol-provider";
1514

1615
// Defines a Mocha test suite to group tests of similar kind together
1716
suite("Extension Tests", () => {
1817
test("symbol provider works as expected", async () => {
19-
const filePath = "/test/resources/sample.f90";
20-
const openPath = vscode.Uri.file(`${vscode.workspace.rootPath}${filePath}`);
18+
const filePath = path.resolve(__dirname, "../../test/resources/sample.f90");
19+
const openPath = vscode.Uri.file(filePath);
2120
const doc = await vscode.workspace.openTextDocument(openPath);
2221
vscode.window.showTextDocument(doc);
2322
const symbolProvider = new FortranDocumentSymbolProvider();

0 commit comments

Comments
 (0)