-
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
test output format #414
Comments
No objection. I probably won't implement this myself, but would be happy to help someone through submitting a patch for it. |
Oh, I see that you closed this. I'm going to reopen it if that's ok, it's not a bad idea. |
Yes, I had closed this because I realized that the tests do not output javascript code but simply perform a Parsing it works with basic types (Plain object, array and primitive) but will not work with other types (Date, Set, Function, Symbol, ...) So I'm not sure if this issue makes sense. Eventually a JSON output could make sense but would be limited to stringifyable types. |
It depends on what you want to do with the output. If you want relatively high-fidelity, we could output CBOR for instance. |
a library like devalue could also be a solution. |
I could imagine something like devalue output as an option, but it's not really pretty enough for human consumption. If you want JS out, maybe something like serialize-javascript or node-tosource? |
Let's consider this command:
that generates this
data.js
file:this output is a javascript statement but cant be used as a js file.
I suggest to add a
--test-output-format
optionexamples:
--test-output-format es
:--test-output-format commonjs
:--test-output-format json
:This is the way I currently work around this problem:
The text was updated successfully, but these errors were encountered: