diff options
| author | Andrei Listochkin <andrei.listochkin@ferrous-systems.com> | 2022-05-11 13:34:43 +0100 |
|---|---|---|
| committer | Andrei Listochkin <andrei.listochkin@ferrous-systems.com> | 2022-05-11 15:50:59 +0100 |
| commit | 684fa2794f0c10280ff7b9fbcda73d5c7c1cf204 (patch) | |
| tree | e42e0726193797074278277b7afff09a76aed2c6 /editors/code/tests | |
| parent | 6c769ac00d12cc1436bdbb2bbbce80db0bb8d2d5 (diff) | |
| download | rust-684fa2794f0c10280ff7b9fbcda73d5c7c1cf204.tar.gz rust-684fa2794f0c10280ff7b9fbcda73d5c7c1cf204.zip | |
VSCode variables support for substitutions
Tests now open Rust-Analyzer extension code in order to populate VSCode variables.
Diffstat (limited to 'editors/code/tests')
| -rw-r--r-- | editors/code/tests/runTests.ts | 2 | ||||
| -rw-r--r-- | editors/code/tests/unit/settings.test.ts | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/editors/code/tests/runTests.ts b/editors/code/tests/runTests.ts index 7a8f3ef698b..6172cc7d5f9 100644 --- a/editors/code/tests/runTests.ts +++ b/editors/code/tests/runTests.ts @@ -14,7 +14,7 @@ async function main() { let minimalVersion: string = json.engines.vscode; if (minimalVersion.startsWith('^')) minimalVersion = minimalVersion.slice(1); - const launchArgs = ["--disable-extensions"]; + const launchArgs = ["--disable-extensions", extensionDevelopmentPath]; // All test suites (either unit tests or integration tests) should be in subfolders. const extensionTestsPath = path.resolve(__dirname, './unit/index'); diff --git a/editors/code/tests/unit/settings.test.ts b/editors/code/tests/unit/settings.test.ts index f4b022b421c..dca4e38d138 100644 --- a/editors/code/tests/unit/settings.test.ts +++ b/editors/code/tests/unit/settings.test.ts @@ -49,5 +49,13 @@ export async function getTests(ctx: Context) { const actualEnv = await substituteVariablesInEnv(envJson); assert.deepStrictEqual(actualEnv, expectedEnv); }); + + suite.addTest('should support VSCode variables', async () => { + const envJson = { + USING_VSCODE_VAR: "${workspaceFolderBasename}" + }; + const actualEnv = await substituteVariablesInEnv(envJson); + assert.deepStrictEqual(actualEnv.USING_VSCODE_VAR, 'code'); + }); }); } |
