-
Notifications
You must be signed in to change notification settings - Fork 3k
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(take): refactor test use rxsandbox #3266
Conversation
@david-driscoll plz check this out too. |
Generated by 🚫 dangerJS |
So far it looks okay to me... @jayphelps, I know you have keen interest in this, what do you think? @kwonoj: can we get the changes that exist in rx-sandbox implemented in core? What documentation exists for this? Did you happen to write down any design rationale? |
Mostly |
I think we should pull them into core, rather than depend on rx-sandbox. If you go with this new API I'd prefer some bikesheddding around the name It does feel a bit weird that it's mutable array that changes as virtual time advances. e.g. this example in the docs const e1 = hot(' --a--b--|');
const subs = s(` ^ !`);
const messages = getMessages(e1.mapTo('x'));
//at this moment, messages are empty!
expect(messages).to.be.empty;
advanceTo(3);
const expected = e('--x------'); // we're flushing to frame 3 only, so rest of marbles are not constructed
//now values are available
expect(messages).to.deep.equal(expected);
//subscriptions are also available too
expect(e1.subscriptions).to.deep.equal(subs); I'm not sure if this is weird enough for me to object, just was my initial reaction. It's probably fine or even ideal. |
Agreed, consider this if POC only. I don't think it's viable to make rx-sandbox as dep, first we'd go for core and eventually create separate pkg once we have core side monorepo.
debatable, obviously. For me it's kinda-ok api, as This design is based on intention of you're getting notification metadata array directly so you can assert as you want - while given array is mutable so over virtual time passes you get updated values. If there's better ergonomics, this can be discussed over via first PR migrating sandbox impl to core. /cc @jayphelps ☝️ |
closing as same reason for #3314 . |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description:
DONOTMERGE (Test will fail anyway, so can't be merged)
related to #3254, #3231 and #3265.
This PR is poc attempt to move our test assertion to use
rx-sandbox
instead, provides strong type safety around interfaces, as well as fixes some of known issues in current test assertion.Unfortunately there is one nasty issue - since rx-sandbox has deps to Rx, there are 2 observable object (from source we'd like to assert, and one rx-sandbox uses internally) and it creates some conflict around scheduling, so couple of subscription tests are failing in here.
Not entirely sure how this can be resolved in quick manner - probably best thing is setting up monorepo and use linked pkg to source allows to have same object over, otherwise we may need to port changes of sandbox into core / or try to expose override rxsandbox to import source directly. Opening up as discussion, since @david-driscoll created PR around current test assertion - we may need to decide which way before make actions.
Related issue (if exists):