-
Notifications
You must be signed in to change notification settings - Fork 757
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate Bicep.MSBuild.E2eTests to use vitest (#15272)
- Migrated from jest to vitest - Cleaned up ESLint dependencies and config file The next step is to consolidate `Bicep.Cli.E2eTests` and `Bicep.MSBuild.E2eTests` into a mono workspace to further reduce the maintenance overhead of npm projects.. ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/15272)
- Loading branch information
Showing
26 changed files
with
2,223 additions
and
7,109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ | ||
"version": 1, | ||
"dependencies": { | ||
"net8.0": { | ||
"Microsoft.CodeAnalysis.BannedApiAnalyzers": { | ||
"type": "Direct", | ||
"requested": "[3.3.4, )", | ||
"resolved": "3.3.4", | ||
"contentHash": "0k2Jwpc8eq0hjOtX6TxRkHm9clkJ2PAQ3heEHgqIJZcsfdFosC/iyz18nsgTVDDWpID80rC7aiYK7ripx+Qndg==" | ||
}, | ||
"Microsoft.SourceLink.GitHub": { | ||
"type": "Direct", | ||
"requested": "[8.0.0, )", | ||
"resolved": "8.0.0", | ||
"contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", | ||
"dependencies": { | ||
"Microsoft.Build.Tasks.Git": "8.0.0", | ||
"Microsoft.SourceLink.Common": "8.0.0" | ||
} | ||
}, | ||
"Microsoft.VisualStudio.Threading.Analyzers": { | ||
"type": "Direct", | ||
"requested": "[17.11.20, )", | ||
"resolved": "17.11.20", | ||
"contentHash": "yI80R8Ja4ipU7/fyVAMCu0oGTN/u97OgL99gd/8ycGnCF58Kn93iBU3T7rkxGMnlsHf5vEgRu95dujtYcgwf9Q==" | ||
}, | ||
"Nerdbank.GitVersioning": { | ||
"type": "Direct", | ||
"requested": "[3.6.146, )", | ||
"resolved": "3.6.146", | ||
"contentHash": "W1eQ8hD9Y/cZ2+ilgxECl003xr1hybpN3fMxoTlMqg++BixETBMWzS4y9s08oHJKXgKtudsoxhITNOEf1OR66w==" | ||
}, | ||
"System.IO.Abstractions": { | ||
"type": "Direct", | ||
"requested": "[21.0.29, )", | ||
"resolved": "21.0.29", | ||
"contentHash": "EqqngPcNhqjGHKYVjhfU8D/l3rj/m00VaXxuRrWjal38Kw8kqN3f63sj69b/8Q6OAeJkA/nbWsn/iwPMqCQvfg==", | ||
"dependencies": { | ||
"TestableIO.System.IO.Abstractions": "21.0.29", | ||
"TestableIO.System.IO.Abstractions.Wrappers": "21.0.29" | ||
} | ||
}, | ||
"Microsoft.Build.Tasks.Git": { | ||
"type": "Transitive", | ||
"resolved": "8.0.0", | ||
"contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" | ||
}, | ||
"Microsoft.SourceLink.Common": { | ||
"type": "Transitive", | ||
"resolved": "8.0.0", | ||
"contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" | ||
}, | ||
"TestableIO.System.IO.Abstractions": { | ||
"type": "Transitive", | ||
"resolved": "21.0.29", | ||
"contentHash": "3TtSs2i0m0QqpAI4EzR1vZXQuHNw5grBy0rDKqMkWi6ySEZ+yhN9HACgIyEq7gDXPLrtQI18ud/OtI0qVhP8Mg==" | ||
}, | ||
"TestableIO.System.IO.Abstractions.Wrappers": { | ||
"type": "Transitive", | ||
"resolved": "21.0.29", | ||
"contentHash": "bm1stQx3rGV2qBW2xAAvl8ODVGNVkiAkqNsE+LsKfhMamBUa07IgsgMc9X/zBHc5yfAJOqJIUArQ56DDgwGyYA==", | ||
"dependencies": { | ||
"TestableIO.System.IO.Abstractions": "21.0.29" | ||
} | ||
} | ||
}, | ||
"net8.0/linux-arm64": {}, | ||
"net8.0/linux-musl-x64": {}, | ||
"net8.0/linux-x64": {}, | ||
"net8.0/osx-arm64": {}, | ||
"net8.0/osx-x64": {}, | ||
"net8.0/win-arm64": {}, | ||
"net8.0/win-x64": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"printWidth": 120, | ||
"plugins": ["@ianvs/prettier-plugin-sort-imports"], | ||
"importOrder": [ | ||
"<TYPES>^(node:)", | ||
"<TYPES>", | ||
"<TYPES>^[.]", | ||
"", | ||
"<BUILTIN_MODULES>", | ||
"<THIRD_PARTY_MODULES>", | ||
"^[./]" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,35 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
// @ts-check | ||
import eslint from "@eslint/js"; | ||
import tseslint from "typescript-eslint"; | ||
import vitest from "@vitest/eslint-plugin"; | ||
import notice from "eslint-plugin-notice"; | ||
import tsParser from "@typescript-eslint/parser"; | ||
import globals from "globals"; | ||
import path from "node:path"; | ||
import { fileURLToPath } from "node:url"; | ||
import js from "@eslint/js"; | ||
import { FlatCompat } from "@eslint/eslintrc"; | ||
|
||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: js.configs.recommended, | ||
allConfig: js.configs.all | ||
}); | ||
|
||
export default [{ | ||
ignores: ["out/**/*"], | ||
}, ...compat.extends("eslint:recommended", "plugin:prettier/recommended"), { | ||
plugins: { | ||
notice, | ||
}, | ||
|
||
languageOptions: { | ||
parser: tsParser, | ||
ecmaVersion: 2020, | ||
sourceType: "module", | ||
|
||
parserOptions: { | ||
project: "./tsconfig.json", | ||
}, | ||
}, | ||
|
||
rules: { | ||
"notice/notice": [ | ||
2, | ||
{ | ||
"templateFile": "../copyright-template.js", | ||
} | ||
] | ||
export default tseslint.config({ | ||
files: ["src/**/*.ts"], | ||
extends: [eslint.configs.recommended, ...tseslint.configs.recommended], | ||
languageOptions: { | ||
ecmaVersion: 2020, | ||
globals: { | ||
...vitest.environments.env.globals, | ||
}, | ||
}, ...compat.extends( | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:jest/recommended", | ||
"plugin:prettier/recommended", | ||
).map(config => ({ | ||
...config, | ||
files: ["**/*.ts"], | ||
})), { | ||
files: ["**/*.ts"], | ||
|
||
rules: { | ||
"jest/no-hooks": "off", | ||
"jest/prefer-expect-assertions": "off", | ||
|
||
"jest/expect-expect": ["error", { | ||
assertFunctionNames: ["expect*"], | ||
}], | ||
|
||
"jest/prefer-importing-jest-globals": "off", | ||
}, | ||
}, { | ||
files: ["**/*.js"], | ||
|
||
languageOptions: { | ||
globals: { | ||
...globals.node, | ||
}, | ||
}, | ||
}]; | ||
}, | ||
plugins: { notice, vitest }, | ||
rules: { | ||
"notice/notice": [ | ||
"error", | ||
{ | ||
templateFile: "../copyright-template.js", | ||
}, | ||
], | ||
...vitest.configs.recommended.rules, | ||
"vitest/expect-expect": [ | ||
"error", | ||
{ | ||
assertFunctionNames: ["expect", "expect*", "**.expect*"], | ||
}, | ||
], | ||
}, | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.