Skip to content

Commit

Permalink
Update emitting timestamps during testing
Browse files Browse the repository at this point in the history
  • Loading branch information
sheetalkamat committed Sep 24, 2019
1 parent 220ee81 commit 382ff17
Show file tree
Hide file tree
Showing 120 changed files with 739 additions and 730 deletions.
2 changes: 1 addition & 1 deletion src/compiler/tsbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ namespace ts {
*/
export function createBuilderStatusReporter(system: System, pretty?: boolean): DiagnosticReporter {
return diagnostic => {
let output = pretty ? `[${formatColorAndReset((system.now ? system.now() : new Date()).toLocaleTimeString(), ForegroundColorEscapeSequences.Grey)}] ` : `${(system.now ? system.now() : new Date()).toLocaleTimeString()} - `;
let output = pretty ? `[${formatColorAndReset(getLocaleTimeString(system), ForegroundColorEscapeSequences.Grey)}] ` : `${getLocaleTimeString(system)} - `;
output += `${flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)}${system.newLine + system.newLine}`;
system.write(output);
};
Expand Down
13 changes: 11 additions & 2 deletions src/compiler/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,23 @@ namespace ts {
: newLine;
}

/**
* Get locale specific time based on whether we are in test mode
*/
export function getLocaleTimeString(system: System) {
return !system.now ?
new Date().toLocaleTimeString() :
system.now().toLocaleTimeString("en-US", { timeZone: "UTC" });
}

/**
* Create a function that reports watch status by writing to the system and handles the formating of the diagnostic
*/
export function createWatchStatusReporter(system: System, pretty?: boolean): WatchStatusReporter {
return pretty ?
(diagnostic, newLine, options) => {
clearScreenIfNotWatchingForFileChanges(system, diagnostic, options);
let output = `[${formatColorAndReset(new Date().toLocaleTimeString(), ForegroundColorEscapeSequences.Grey)}] `;
let output = `[${formatColorAndReset(getLocaleTimeString(system), ForegroundColorEscapeSequences.Grey)}] `;
output += `${flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)}${newLine + newLine}`;
system.write(output);
} :
Expand All @@ -72,7 +81,7 @@ namespace ts {
output += newLine;
}

output += `${new Date().toLocaleTimeString()} - `;
output += `${getLocaleTimeString(system)} - `;
output += `${flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)}${getPlainDiagnosticFollowingNewLines(diagnostic, newLine)}`;

system.write(output);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
//// [/lib/incremental-declaration-doesnt-changeOutput.txt]
/lib/tsc --b /src/app --verbose
4:04:00 PM - Projects in this build:
12:04:00 AM - Projects in this build:
* src/lib/tsconfig.json
* src/app/tsconfig.json

4:04:00 PM - Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts'
12:04:00 AM - Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts'

4:04:00 PM - Building project '/src/lib/tsconfig.json'...
12:04:00 AM - Building project '/src/lib/tsconfig.json'...

4:04:00 PM - Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed
12:04:00 AM - Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed

4:04:00 PM - Updating output of project '/src/app/tsconfig.json'...
12:04:00 AM - Updating output of project '/src/app/tsconfig.json'...

4:04:00 PM - Updating unchanged output timestamps of project '/src/app/tsconfig.json'...
12:04:00 AM - Updating unchanged output timestamps of project '/src/app/tsconfig.json'...

exitCode:: 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
//// [/lib/incremental-declaration-doesnt-changeOutput.txt]
/lib/tsc --b /src/app --verbose
4:04:00 PM - Projects in this build:
12:04:00 AM - Projects in this build:
* src/lib/tsconfig.json
* src/app/tsconfig.json

4:04:00 PM - Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts'
12:04:00 AM - Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts'

4:04:00 PM - Building project '/src/lib/tsconfig.json'...
12:04:00 AM - Building project '/src/lib/tsconfig.json'...

4:04:00 PM - Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed
12:04:00 AM - Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed

4:04:00 PM - Updating output of project '/src/app/tsconfig.json'...
12:04:00 AM - Updating output of project '/src/app/tsconfig.json'...

4:04:00 PM - Updating unchanged output timestamps of project '/src/app/tsconfig.json'...
12:04:00 AM - Updating unchanged output timestamps of project '/src/app/tsconfig.json'...

exitCode:: 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
//// [/lib/incremental-declaration-doesnt-changeOutput.txt]
/lib/tsc --b /src/app --verbose
4:04:00 PM - Projects in this build:
12:04:00 AM - Projects in this build:
* src/lib/tsconfig.json
* src/app/tsconfig.json

4:04:00 PM - Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts'
12:04:00 AM - Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts'

4:04:00 PM - Building project '/src/lib/tsconfig.json'...
12:04:00 AM - Building project '/src/lib/tsconfig.json'...

4:04:00 PM - Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed
12:04:00 AM - Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed

4:04:00 PM - Updating output of project '/src/app/tsconfig.json'...
12:04:00 AM - Updating output of project '/src/app/tsconfig.json'...

4:04:00 PM - Updating unchanged output timestamps of project '/src/app/tsconfig.json'...
12:04:00 AM - Updating unchanged output timestamps of project '/src/app/tsconfig.json'...

exitCode:: 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
//// [/lib/incremental-declaration-doesnt-changeOutput.txt]
/lib/tsc --b /src/app --verbose
4:04:00 PM - Projects in this build:
12:04:00 AM - Projects in this build:
* src/lib/tsconfig.json
* src/app/tsconfig.json

4:04:00 PM - Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts'
12:04:00 AM - Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts'

4:04:00 PM - Building project '/src/lib/tsconfig.json'...
12:04:00 AM - Building project '/src/lib/tsconfig.json'...

4:04:00 PM - Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed
12:04:00 AM - Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed

4:04:00 PM - Updating output of project '/src/app/tsconfig.json'...
12:04:00 AM - Updating output of project '/src/app/tsconfig.json'...

4:04:00 PM - Updating unchanged output timestamps of project '/src/app/tsconfig.json'...
12:04:00 AM - Updating unchanged output timestamps of project '/src/app/tsconfig.json'...

exitCode:: 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
//// [/lib/incremental-declaration-doesnt-changeOutput.txt]
/lib/tsc --b /src/app --verbose
4:04:00 PM - Projects in this build:
12:04:00 AM - Projects in this build:
* src/lib/tsconfig.json
* src/app/tsconfig.json

4:04:00 PM - Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts'
12:04:00 AM - Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts'

4:04:00 PM - Building project '/src/lib/tsconfig.json'...
12:04:00 AM - Building project '/src/lib/tsconfig.json'...

4:04:00 PM - Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed
12:04:00 AM - Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed

4:04:00 PM - Updating output of project '/src/app/tsconfig.json'...
12:04:00 AM - Updating output of project '/src/app/tsconfig.json'...

4:04:00 PM - Updating unchanged output timestamps of project '/src/app/tsconfig.json'...
12:04:00 AM - Updating unchanged output timestamps of project '/src/app/tsconfig.json'...

exitCode:: 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
//// [/lib/incremental-declaration-doesnt-changeOutput.txt]
/lib/tsc --b /src/app --verbose
4:04:00 PM - Projects in this build:
12:04:00 AM - Projects in this build:
* src/lib/tsconfig.json
* src/app/tsconfig.json

4:04:00 PM - Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts'
12:04:00 AM - Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts'

4:04:00 PM - Building project '/src/lib/tsconfig.json'...
12:04:00 AM - Building project '/src/lib/tsconfig.json'...

4:04:00 PM - Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed
12:04:00 AM - Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed

4:04:00 PM - Updating output of project '/src/app/tsconfig.json'...
12:04:00 AM - Updating output of project '/src/app/tsconfig.json'...

4:04:00 PM - Updating unchanged output timestamps of project '/src/app/tsconfig.json'...
12:04:00 AM - Updating unchanged output timestamps of project '/src/app/tsconfig.json'...

exitCode:: 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
//// [/lib/incremental-headers-change-without-dts-changesOutput.txt]
/lib/tsc --b /src/app --verbose
4:08:00 PM - Projects in this build:
12:08:00 AM - Projects in this build:
* src/lib/tsconfig.json
* src/app/tsconfig.json

4:08:00 PM - Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts'
12:08:00 AM - Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts'

4:08:00 PM - Building project '/src/lib/tsconfig.json'...
12:08:00 AM - Building project '/src/lib/tsconfig.json'...

4:08:00 PM - Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed
12:08:00 AM - Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed

4:08:00 PM - Updating output of project '/src/app/tsconfig.json'...
12:08:00 AM - Updating output of project '/src/app/tsconfig.json'...

4:08:00 PM - Updating unchanged output timestamps of project '/src/app/tsconfig.json'...
12:08:00 AM - Updating unchanged output timestamps of project '/src/app/tsconfig.json'...

exitCode:: 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
//// [/lib/incremental-headers-change-without-dts-changesOutput.txt]
/lib/tsc --b /src/app --verbose
4:08:00 PM - Projects in this build:
12:08:00 AM - Projects in this build:
* src/lib/tsconfig.json
* src/app/tsconfig.json

4:08:00 PM - Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts'
12:08:00 AM - Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts'

4:08:00 PM - Building project '/src/lib/tsconfig.json'...
12:08:00 AM - Building project '/src/lib/tsconfig.json'...

4:08:00 PM - Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed
12:08:00 AM - Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed

4:08:00 PM - Updating output of project '/src/app/tsconfig.json'...
12:08:00 AM - Updating output of project '/src/app/tsconfig.json'...

4:08:00 PM - Updating unchanged output timestamps of project '/src/app/tsconfig.json'...
12:08:00 AM - Updating unchanged output timestamps of project '/src/app/tsconfig.json'...

exitCode:: 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
//// [/lib/incremental-headers-change-without-dts-changesOutput.txt]
/lib/tsc --b /src/app --verbose
4:08:00 PM - Projects in this build:
12:08:00 AM - Projects in this build:
* src/lib/tsconfig.json
* src/app/tsconfig.json

4:08:00 PM - Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts'
12:08:00 AM - Project 'src/lib/tsconfig.json' is out of date because oldest output 'src/lib/module.js' is older than newest input 'src/lib/file1.ts'

4:08:00 PM - Building project '/src/lib/tsconfig.json'...
12:08:00 AM - Building project '/src/lib/tsconfig.json'...

4:08:00 PM - Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed
12:08:00 AM - Project 'src/app/tsconfig.json' is out of date because output of its dependency 'src/lib' has changed

4:08:00 PM - Updating output of project '/src/app/tsconfig.json'...
12:08:00 AM - Updating output of project '/src/app/tsconfig.json'...

exitCode:: 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
//// [/lib/initial-buildOutput.txt]
/lib/tsc --b /src/app --verbose
4:01:00 PM - Projects in this build:
12:01:00 AM - Projects in this build:
* src/lib/tsconfig.json
* src/app/tsconfig.json

4:01:00 PM - Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist
12:01:00 AM - Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist

4:01:00 PM - Building project '/src/lib/tsconfig.json'...
12:01:00 AM - Building project '/src/lib/tsconfig.json'...

4:01:00 PM - Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist
12:01:00 AM - Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist

4:01:00 PM - Building project '/src/app/tsconfig.json'...
12:01:00 AM - Building project '/src/app/tsconfig.json'...

exitCode:: 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
//// [/lib/initial-buildOutput.txt]
/lib/tsc --b /src/app --verbose
4:01:00 PM - Projects in this build:
12:01:00 AM - Projects in this build:
* src/lib/tsconfig.json
* src/app/tsconfig.json

4:01:00 PM - Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist
12:01:00 AM - Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist

4:01:00 PM - Building project '/src/lib/tsconfig.json'...
12:01:00 AM - Building project '/src/lib/tsconfig.json'...

4:01:00 PM - Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist
12:01:00 AM - Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist

4:01:00 PM - Building project '/src/app/tsconfig.json'...
12:01:00 AM - Building project '/src/app/tsconfig.json'...

exitCode:: 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
//// [/lib/initial-buildOutput.txt]
/lib/tsc --b /src/app --verbose
4:01:00 PM - Projects in this build:
12:01:00 AM - Projects in this build:
* src/lib/tsconfig.json
* src/app/tsconfig.json

4:01:00 PM - Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist
12:01:00 AM - Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist

4:01:00 PM - Building project '/src/lib/tsconfig.json'...
12:01:00 AM - Building project '/src/lib/tsconfig.json'...

4:01:00 PM - Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist
12:01:00 AM - Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist

4:01:00 PM - Building project '/src/app/tsconfig.json'...
12:01:00 AM - Building project '/src/app/tsconfig.json'...

exitCode:: 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
//// [/lib/initial-buildOutput.txt]
/lib/tsc --b /src/app --verbose
4:01:00 PM - Projects in this build:
12:01:00 AM - Projects in this build:
* src/lib/tsconfig.json
* src/app/tsconfig.json

4:01:00 PM - Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist
12:01:00 AM - Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist

4:01:00 PM - Building project '/src/lib/tsconfig.json'...
12:01:00 AM - Building project '/src/lib/tsconfig.json'...

4:01:00 PM - Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist
12:01:00 AM - Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist

4:01:00 PM - Building project '/src/app/tsconfig.json'...
12:01:00 AM - Building project '/src/app/tsconfig.json'...

exitCode:: 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
//// [/lib/initial-buildOutput.txt]
/lib/tsc --b /src/app --verbose
4:01:00 PM - Projects in this build:
12:01:00 AM - Projects in this build:
* src/lib/tsconfig.json
* src/app/tsconfig.json

4:01:00 PM - Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist
12:01:00 AM - Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist

4:01:00 PM - Building project '/src/lib/tsconfig.json'...
12:01:00 AM - Building project '/src/lib/tsconfig.json'...

4:01:00 PM - Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist
12:01:00 AM - Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist

4:01:00 PM - Building project '/src/app/tsconfig.json'...
12:01:00 AM - Building project '/src/app/tsconfig.json'...

exitCode:: 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
//// [/lib/initial-buildOutput.txt]
/lib/tsc --b /src/app --verbose
4:01:00 PM - Projects in this build:
12:01:00 AM - Projects in this build:
* src/lib/tsconfig.json
* src/app/tsconfig.json

4:01:00 PM - Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist
12:01:00 AM - Project 'src/lib/tsconfig.json' is out of date because output file 'src/lib/module.js' does not exist

4:01:00 PM - Building project '/src/lib/tsconfig.json'...
12:01:00 AM - Building project '/src/lib/tsconfig.json'...

4:01:00 PM - Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist
12:01:00 AM - Project 'src/app/tsconfig.json' is out of date because output file 'src/app/module.js' does not exist

4:01:00 PM - Building project '/src/app/tsconfig.json'...
12:01:00 AM - Building project '/src/app/tsconfig.json'...

exitCode:: 0

Expand Down
Loading

0 comments on commit 382ff17

Please sign in to comment.