-
-
Notifications
You must be signed in to change notification settings - Fork 305
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
Added t.diag() method to print yaml metadata #99
base: master
Are you sure you want to change the base?
Conversation
The diag implementation looks good. It's a useful method, explain() would also be really useful, i'd use that one more. Thanks for the very detailed pull request :) |
@Raynos Implementing Also, should @Ovid any thoughts on diagnostic output levels versus a simple on/off switch? |
I don't think explain() needs anything akin to log levels primarily because I use it when I'm writing new tests and implementing a feature. When I do that, I want to see those explain messages — all of them. Thus, for me it really is a boolean on/off. That being said, maybe someone else has a different use case I'm unaware. I teach a lot of people how to test and I haven't seen a different use case, but it doesn't mean it doesn't exist. OvidIT consulting, training, international recruiting On Friday, 15 August 2014, 12:17, Andrew de Andrade [email protected] wrote:
|
I personally like Probably supporting |
@Raynos you, sir, are an officer and a gentleman. thank you. I'll open up a new pull request for Personally, my two favorites are your two favorites as well. The Is there any reason to support both the query string and the hash section? Seems like only one should be implemented for simplicity and that querystring is a better choice since it's semantically congruent with the intent of querystrings (whereas hashes were originally meant to be for anchors and AFAIK either don't support an X=Y syntax or at least was never meant to). Agree that the For the ENV vars, is there a browserify "transform"/"plugin" that supports receiving an array of ENV variables that should be included in the final browserified script as a global? i.e. |
@malandrew I prefer a i.e. I think doing both query & hash in the uri is overkill, query string is fine. There is an https://github.com/hughsk/envify transform that inlines all |
Do we still want this ? If so we can #shipit |
@Raynos Yes! tap-parser supports diag so it would be good |
👍 can we get this merged in? |
It needs a rebase and conflicts resolved, or, the "allow edits" checkbox checked. |
@isaacs are you maintaining this repo also? |
@gabrielcsapo please don't ping arbitrary people unnecessarily; this PR can't be merged until the OP, @malandrew, updates it. |
I was going to rebase the commit if @malandrew didn't respond. I was asking the question to |
Yes, of course tape is being maintained, by multiple people. I'd prefer the original poster be the one to do it, so we can modify this PR in-place instead of creating another one and polluting the git log. |
I am not maintaining tape. All the tap-related things I do are under the |
@isaacs does that mean node-tape is being deprecated in favor of tapjs? |
@gabrielcsapo No. Tape and node-tap are separate projects. Always have been. |
@isaacs okay, but the output is based on the tap standard version 13 currently right? I was looking to see if tape would be updated to adhere to that spec. |
@andrewdeandrade can you please check the "allow edits" checkbox on the RHS of the PR? |
Closing out due to lack of activity. |
I prefer to keep inactive PRs open, in case the author returns. |
c16dde3
to
2ad86d4
Compare
This pull requests implements a
t.diag()
method that takes JSON and can print out the json as a YAML block. FWIW this adds jeremyfa/yaml.js as a new dependency, but that dependency works in browsers.This would close #91 but before we do, I think it may be worth discussing this a bit.
The TAP specification states:
This seems to imply that extended diagnostic information should be attached to the preceding test. Having a standalone
diag()
method in a way implies that the diagnostic information to be printed is standalone information.Now, the way I see it, there are three options here:
t.ok(true, 'Some message', someDiagnosticJSONObj)
. However, his approach would require quite a bit of reworking oftape
since tape uses the third argument internally as anextra
argument. This means that you'd have to do some whitelisting of theextra
property object when you print it out.Lastly, should we allow people to pass in YAML content directly into the
diag
method? AFAICT, the only thing necessary to do this is to check if the argument todiag()
is a string or a plain old javascript object, and handle it accordingly.Anyone have any strong thoughts here?
(FWIW I also looked into using
YAML.stringify
in theerrorYAML
function, but that didn't really work because it would YAMLize theactual
andexpected
properties, even if they were JSON objects.)