Skip to content

Commit c7e15ba

Browse files
authored
eng: More rule updates (#2126)
1 parent ef4f8fc commit c7e15ba

5 files changed

Lines changed: 11 additions & 5 deletions

File tree

eng/MIGRATION.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1. Run `npm i --save-dev @microsoft/vscode-azext-eng` to install the latest eng package. Bye bye small package-lock.json.
1010
1. Update your .nvmrc to Node 22+, and update `@types/node` accordingly. The minimum VS Code version for Node 22 is 1.101.0.
1111
As appropriate, add a minimum VS Code engine version to your package.json as well.
12-
1. If needed, update `@microsoft/vscode-azext-utils` to 4.0.1 to get the replacements for TestUserInput, TestActionContext, etc.
12+
1. If needed, update `@microsoft/vscode-azext-utils` to 4.0.2 to get the replacements for TestUserInput, TestActionContext, etc.
1313

1414
# Migrating an NPM package to use this
1515
This is relatively easy.
@@ -126,7 +126,8 @@ Your tests run in the VS Code extension test host, because **you do have VS Code
126126
> - ❌ Variables or other state you expect to be shared
127127
>
128128
> To migrate, you may have to rewrite the tests to be more like unit tests, or otherwise, export the necessary
129-
> objects from the extension API *but only when running tests*. Use a magic environment variable to control that.
129+
> objects from the extension API *but only when running tests*. You can test the `VSCODE_RUNNING_TESTS` env var,
130+
> which is set in the base test config.
130131
1. Also fix other imports as needed.
131132
1. Create a .vscode-test.mjs file at the root. Read more [here](./src/vscode-test/README.md).
132133
1. Run the tests. Take note of how many are running, and make sure it's the same as before.

eng/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@microsoft/vscode-azext-eng",
33
"author": "Microsoft Corporation",
4-
"version": "1.0.0-alpha.2",
4+
"version": "1.0.0-alpha.3",
55
"description": "Engineering package for Azure extensions for VS Code",
66
"repository": {
77
"type": "git",

eng/src/eslint/eslintConfigs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export const azExtTestRules: EslintConfig = {
4545
files: ['**/*.test.ts'],
4646
rules: {
4747
'@typescript-eslint/no-explicit-any': 'off', // Allow 'any' in test files
48+
'@typescript-eslint/no-non-null-assertion': 'off', // Allow non-null assertions in test files
4849
'@typescript-eslint/no-unsafe-assignment': 'off', // Allow unsafe assignments in test files
4950
},
5051
};

eng/src/vscode-test/vscodeTestConfigs.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ export const baseConfig: Partial<VscodeTestConfig> = {
1414
require: ['tsx'],
1515
timeout: 10000,
1616
},
17+
env: {
18+
// eslint-disable-next-line @typescript-eslint/naming-convention
19+
VSCODE_RUNNING_TESTS: '1',
20+
},
1721
};
1822

1923
/**

0 commit comments

Comments
 (0)