Skip to content

Commit cf6a10c

Browse files
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>
1 parent d8a3e49 commit cf6a10c

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

extensions/ql-vscode/gulpfile.ts/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as gulp from 'gulp';
22
import { compileTypeScript, watchTypeScript, cleanOutput } from './typescript';
33
import { compileTextMateGrammar } from './textmate';
4-
import { copyTestData } from './tests';
4+
import { copyTestData, watchTestData } from './tests';
55
import { compileView, watchView } from './webpack';
66
import { packageExtension } from './package';
77
import { injectAppInsightsKey } from './appInsights';
@@ -21,6 +21,7 @@ export {
2121
watchView,
2222
compileTypeScript,
2323
copyTestData,
24+
watchTestData,
2425
injectAppInsightsKey,
2526
compileView,
2627
};

extensions/ql-vscode/gulpfile.ts/tests.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ export function copyTestData() {
66
return Promise.resolve();
77
}
88

9+
export function watchTestData() {
10+
return gulp.watch(['src/vscode-tests/no-workspace/data/**/*', 'src/vscode-tests/minimal-workspace/data/**/*'], copyTestData);
11+
}
12+
913
function copyNoWorkspaceData() {
1014
return gulp.src('src/vscode-tests/no-workspace/data/**/*')
1115
.pipe(gulp.dest('out/vscode-tests/no-workspace/data'));

extensions/ql-vscode/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,7 @@
12531253
"watch": "npm-run-all -p watch:*",
12541254
"watch:extension": "tsc --watch",
12551255
"watch:webpack": "gulp watchView",
1256+
"watch:files": "gulp watchTestData",
12561257
"test": "npm-run-all -p test:*",
12571258
"test:unit": "mocha --config .mocharc.json test/pure-tests/**/*.ts",
12581259
"test:view": "jest",

0 commit comments

Comments
 (0)