Introduce watch method for test files

Because we're no longer running `gulp` when we run our test command,
we're going to need a way to update our test files when they change.

This will watch for any changes in our test files and copy the new
version over.

Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
This commit is contained in:
Elena Tanasoiu
2022-11-02 15:50:59 +00:00
parent d8a3e49d19
commit cf6a10ccb2
3 changed files with 7 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
import * as gulp from 'gulp';
import { compileTypeScript, watchTypeScript, cleanOutput } from './typescript';
import { compileTextMateGrammar } from './textmate';
import { copyTestData } from './tests';
import { copyTestData, watchTestData } from './tests';
import { compileView, watchView } from './webpack';
import { packageExtension } from './package';
import { injectAppInsightsKey } from './appInsights';
@@ -21,6 +21,7 @@ export {
watchView,
compileTypeScript,
copyTestData,
watchTestData,
injectAppInsightsKey,
compileView,
};

View File

@@ -6,6 +6,10 @@ export function copyTestData() {
return Promise.resolve();
}
export function watchTestData() {
return gulp.watch(['src/vscode-tests/no-workspace/data/**/*', 'src/vscode-tests/minimal-workspace/data/**/*'], copyTestData);
}
function copyNoWorkspaceData() {
return gulp.src('src/vscode-tests/no-workspace/data/**/*')
.pipe(gulp.dest('out/vscode-tests/no-workspace/data'));

View File

@@ -1253,6 +1253,7 @@
"watch": "npm-run-all -p watch:*",
"watch:extension": "tsc --watch",
"watch:webpack": "gulp watchView",
"watch:files": "gulp watchTestData",
"test": "npm-run-all -p test:*",
"test:unit": "mocha --config .mocharc.json test/pure-tests/**/*.ts",
"test:view": "jest",