question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[REQUEST] Add 'get_time' argument to Console's constructor

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
willmcgugancommented, Nov 17, 2020

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…

0reactions
asvetlovcommented, Dec 4, 2020

Cool, thank you very much!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found