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:
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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'));
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user