Skip to content

Commit 1b5c731

Browse files
committed
Add ts to globalThis in run.js for convenience during debugging
In namespaces, we'd have access to a variable named "ts" when debugging, because that was just the ts namespace in the current file. But when modules, that variable doesn't exist, either because we are pure modules (so no ts variable), or named something else (when bundled, for export). Tack a "ts" object onto the globals, which should make this easier. Of course, someone may eventually declare a variable in the top level scope named "ts" and break this, but we can cross that bridge when we come to it.
1 parent 084b7ea commit 1b5c731

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: src/testRunner/runner.ts

+3
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ function beginTests() {
280280

281281
export let isWorker: boolean;
282282
function startTestEnvironment() {
283+
// For debugging convenience.
284+
(globalThis as any).ts = ts;
285+
283286
isWorker = handleTestConfig();
284287
if (isWorker) {
285288
return Parallel.Worker.start();

0 commit comments

Comments
 (0)