-
-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verbose API results #75
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks really good! nice work!
…/tsd into feature/verbose-reporting
Co-authored-by: Sam Verschueren <sam.verschueren@gmail.com>
rebase this now that #74 has landed? |
Still very interested in seeing this land 😀 |
…feature/verbose-reporting
Instead of making a breaking change, maybe const diagnostics = await tsd();
//=> Diagnostic[]
console.log(diagnostics.length);
//=> '0' const verboseResults = await tsd({verbose: true});
//=> {testCount: number, diagnostics: Diagnostic[]}
console.log(verboseResults.testCount);
//=> '1024'
console.log(verboseResults.diagnostics.length);
//=> '0' |
I'm fine with this change. Having an object also gives us the opportunity to add additional properties in the future. |
I don't like options that change the return value type. I think a breaking change is ok here. Programmatic use is not that common. |
TSD either returns a null array if there is no test failures or an array of
Diagnostic
objects. This PR aims to make TSD return withExtendedDiagnostic
object no matter if the tests fail or not.Merging this PR allows custom test runners like Jest to report the number of assertions it evaluated in each file.
It also means that it introduces a breaking change because TSD now returns...
numTests
and nulldiagnostics
array if all tests passed.numTests
and andiagnostics
array populated with test fail reports if a test is failed.This PR is Co-Authored By: