зеркало из https://github.com/dotnet/razor.git
Added ability to run single VSCode functional test. (#1562)
- In VSCode only (F5) you are now prompted with a test file filter that will be applied to the entire list of functional tests. - This does not impact command line runs. dotnet/aspnetcore#17045
This commit is contained in:
Родитель
0daa1809d1
Коммит
b51b3c92c1
|
@ -62,15 +62,18 @@
|
|||
"preLaunchTask": "CompileGrammarTests"
|
||||
},
|
||||
{
|
||||
"name": "Run Functional Tests",
|
||||
"name": "Run Functional Test",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"${workspaceFolder}/src/Razor/test/testapps/",
|
||||
"--extensionDevelopmentPath=${workspaceFolder}/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode.Extension",
|
||||
"--extensionTestsPath=${workspaceFolder}/src/Razor/test/Microsoft.AspNetCore.Razor.VSCode.FunctionalTest/dist/index",
|
||||
"--extensionTestsPath=${workspaceFolder}/src/Razor/test/Microsoft.AspNetCore.Razor.VSCode.FunctionalTest/dist/index"
|
||||
],
|
||||
"env": {
|
||||
"runSingleTest": "true"
|
||||
},
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/src/Razor/test/Microsoft.AspNetCore.Razor.VSCode.FunctionalTest/dist/**/*.js",
|
||||
],
|
||||
|
|
|
@ -26,8 +26,22 @@ export async function run(): Promise<void> {
|
|||
await vscode.commands.executeCommand('extension.configureRazorDevMode');
|
||||
}
|
||||
|
||||
let testFilter: string | undefined;
|
||||
if (process.env.runSingleTest === 'true') {
|
||||
testFilter = await vscode.window.showInputBox({
|
||||
prompt: 'Test file filter',
|
||||
placeHolder: '**.test.js',
|
||||
});
|
||||
}
|
||||
|
||||
if (!testFilter) {
|
||||
testFilter = '**.test.js';
|
||||
} else if (!testFilter.endsWith('.test.js')) {
|
||||
testFilter += '**.test.js';
|
||||
}
|
||||
|
||||
return new Promise((c, e) => {
|
||||
glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
|
||||
glob(`**/${testFilter}`, { cwd: testsRoot }, (err, files) => {
|
||||
if (err) {
|
||||
return e(err);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче