You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was running through some tests the other day and thought it might be useful to alter this section to support custom names instead of just JSON.stringify in the following code. In my example, I'm using an object with about 8 keys, but I have a unique name/id on each of them which would be easier to read the path.
Here's a screenshot of the output I have in cypress;
If this is something that other people would find useful in the code I'd be happy to make an MR for it (if/when I get the time). At present, it's just a minor annoyance and so far the only one I've found 😁
EDIT: This gets even worse if you start passing in arrays inside the cases - I have over two screens worth of JSON text for one test 😂
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I was running through some tests the other day and thought it might be useful to alter this section to support custom names instead of just
JSON.stringify
in the following code. In my example, I'm using an object with about 8 keys, but I have a unique name/id on each of them which would be easier to read the path.Here's a screenshot of the output I have in cypress;
Proposed code change
https://github.com/davidkpiano/xstate/blob/326b28d25535c8ce1520258b80a119f26847951b/packages/xstate-test/src/index.ts#L137-L145
If this is something that other people would find useful in the code I'd be happy to make an MR for it (if/when I get the time). At present, it's just a minor annoyance and so far the only one I've found 😁
EDIT: This gets even worse if you start passing in arrays inside the cases - I have over two screens worth of JSON text for one test 😂
Beta Was this translation helpful? Give feedback.
All reactions