TestScheduler can't be reused ? Doc is unclear.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 31.7k
- Forks
- 3k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
I simplified my problem to this : I reuse a scheduler for multiple test, reading the doc I thought this would be ok.
But unless I reset the frame at 0, the 2nd test will fail.
Is this expected ? If so that might need a clarification on the marble testing doc.
Anyway, thanks for the good work.
Expected behavior
Both test should pass without reseting the frame.
Reproduction code
const testScheduler = new TestScheduler((actual, expected) => {
console.log(actual, expected, isEqual(actual, expected));
});
const test = (helpers: RunHelpers) => {
const { cold, expectObservable } = helpers;
const source = cold('---a--b--|');
const expected = ' ---a--b--|';
expectObservable(source).toBe(expected);
};
testScheduler.run(test);
testScheduler.frame = 0; // 2nd test fails if removed
testScheduler.run(test);
Reproduction URL
https://stackblitz.com/edit/rxjs-tucw4y?file=index.ts
Version
7.8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked StackBlitz reproduction and the TestScheduler.run calls shown in the issue. Check whether reusing a scheduler without resetting frame is supported; done means the marble testing documentation clearly explains the expected reuse and frame-reset behavior, or the issue is redirected if documentation is not the appropriate fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation, testing-qa
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100