Skip to content

Commit 54670d5

Browse files
authored
feat(test): Miscellaneous improvements to test_tasks.js (#6615)
* feat(tests): Make runTestBlock able to run any gulp task Modify runTestBlock so that it can run any async task, not just ones that return a Promise, by using the async-done package (part of Gulp, and already an indirect dependency) to detect task completion. Celebrate by renaming it to runTestTask. * refactor(tests): Create Tester class to encapsulate test infrastructure - Create Tester class to encapsulate the runTestTask, and reportTestResult and runAll functions. - Remove the unnecessary id parameter from runTestTask (code was already using the .name of the task function object). - Remove --silent flag from npm scripts so as not to suppress syntax error in gulpfiles. * refactor(tests): Invoke buildAdvancedCompilationTest task directly Have the test task invoke the buildAdvancedCompilationTest (via onlyBuildAdvancedCompilationTest, to skip already-run prerequisites) directly, rather than by running npm.
1 parent d37223d commit 54670d5

4 files changed

Lines changed: 229 additions & 141 deletions

File tree

gulpfile.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ module.exports = {
5252
buildAdvancedCompilationTest: buildTasks.buildAdvancedCompilationTest,
5353
gitCreateRC: gitTasks.createRC,
5454
docs: docsTasks.docs,
55-
56-
// Targets intended only for invocation by scripts; may omit prerequisites.
57-
onlyBuildAdvancedCompilationTest: buildTasks.onlyBuildAdvancedCompilationTest,
5855

5956
// Legacy targets, to be deleted.
6057
recompile: releaseTasks.recompile,

package-lock.json

Lines changed: 99 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
"lint:fix": "eslint . --fix",
4343
"langfiles": "gulp langfiles",
4444
"minify": "gulp minify",
45-
"only:compile:advanced": "gulp onlyBuildAdvancedCompilationTest --debug",
4645
"package": "gulp package",
4746
"postinstall": "patch-package",
4847
"prepare": "gulp prepare",
@@ -53,8 +52,8 @@
5352
"release": "gulp gitCreateRC",
5453
"start": "concurrently -n tsc,server \"tsc --watch --preserveWatchOutput --outDir 'build/src' --declarationDir 'build/declarations'\" \"http-server ./ -s -o /tests/playground.html -c-1\"",
5554
"tsc": "gulp tsc",
56-
"test": "gulp --silent test",
57-
"test:generators": "gulp --silent testGenerators",
55+
"test": "gulp test",
56+
"test:generators": "gulp testGenerators",
5857
"test:mocha:interactive": "http-server ./ -o /tests/mocha/index.html -c-1",
5958
"test:compile:advanced": "gulp buildAdvancedCompilationTest --debug",
6059
"updateGithubPages": "npm ci && gulp gitUpdateGithubPages"
@@ -78,6 +77,7 @@
7877
"@microsoft/api-extractor": "^7.29.5",
7978
"@typescript-eslint/eslint-plugin": "^5.33.1",
8079
"@wdio/selenium-standalone-service": "^7.10.1",
80+
"async-done": "^2.0.0",
8181
"chai": "^4.2.0",
8282
"clang-format": "^1.6.0",
8383
"closure-calculate-chunks": "^3.0.2",

0 commit comments

Comments
 (0)