-
Notifications
You must be signed in to change notification settings - Fork 142
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
transcribe unusual spending kata from ES5 to ES6/babel #163
Comments
The code for working with default — as opposed to named — imports and exports, would look like this:
|
^bump. I've definitely noticed that td.replace() doesn't work correctly on my machine using the es6 syntax. Would be awesome if I didn't have to necessarily make an object that my stubs were hanging off of in order to use them considering the es6 syntax and classes is kind of a cover all for the prototypical inheritance behind the scene to begin with. |
Thanks to you both, I haven't lost track of this I just need to get time to reproduce and think through this issue and #159. |
To work around this issue in ES6/babel, we're forced to stick to the This is what I need, so, I'm closing this issue. It should be straightforward enough to factor in ES6 import/export once you've had a chance to look into it:
|
If you don't mind I'd like to leave this open so I can better understand it -- feel free to unsubscribe though! |
Hey Wil, I just set things up exactly how you had them in your first message and it completely worked for me. I didn't experience the issue of the subject not receiving the fakes. Mocha generated this output:
I've pushed this up to a branch for you to play with in Branch here, named |
Awesome. You missed nothing. I missed everything. I had stray Your stuff works great for ES6/babel. I recommend you close this because it is not your issue. |
Yay! Thanks a lot for giving such a detailed reproducible example so we could demonstrate that then! 💚 |
This issue hampers the ideal ES6 workflow inspired by your Unusual Spending Kata in ES5.
(I get the following results whether I use named or default ES6 imports and exports.)
I can get to my first failing test – specifying ES6 named exports – like so:
This forces me to build the following units – using ES6 named exports:
But the concrete unit does not get the ES6 named imports replaced with the test doubles configured in the test:
What do you recommend?
I wish there was something like
td.import('filespec')
that I could use in the test like this:that would ensure the subject is configured with the test doubles from the test.
The text was updated successfully, but these errors were encountered: