[REQUEST] Add 'get_time' argument to Console's constructor
See original GitHub issueI use the following test strategy: create a console with record=True
, print data, and compare console.export_text(syles=True)
with expected string.
This approach works pretty fine except console.log()
calls: the call print the current time by default, I cannot compare the output with the reference easily.
Progress
class already accepts the get_time
callable argument.
It would be nice if the Console
accepts it too, at least for the test simplification.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
Date() constructor - JavaScript - MDN Web Docs - Mozilla
The Date() constructor can create a Date instance or return a string representing the current time.
Read more >How to mock a constructor like new Date() - Stack Overflow
test('mocks a constructor like new Date()', () => { console.log('Normal: ', new Date().getTime()) const mockDate = new Date(1466424490000) const spy = jest ...
Read more >Date and time - The Modern JavaScript Tutorial
Let's meet a new built-in object: Date. It stores the date, time and provides methods for date/time management.
Read more >Passing Parameters - Programming C# [Book] - O'Reilly
Let's return to the Time class and add a GetTime( ) method which returns the hour, minutes, and seconds. Because we cannot return...
Read more >Class DataValidationBuilder | Apps Script - Google Developers
Creates a builder for a data validation rule based on this rule's settings. // Change existing data validation rules that require a date...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Potentially. Although Console requires a datetime, whereas Progress needs the time in seconds. But I guess I could derive the seconds from the datetime.
I’ll look in to it…
Cool, thank you very much!