Skip to content
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

doing a custom non-deep object comparison #84

Open
pocketmax opened this issue Jun 23, 2023 · 0 comments
Open

doing a custom non-deep object comparison #84

pocketmax opened this issue Jun 23, 2023 · 0 comments

Comments

@pocketmax
Copy link

it('bar',marbles(m =>{
    const vals = {
        a: {
            x: 10,
            y: 20,
            z: 30
        }
    }
    const stream = new Observable((sub)=>{
        sub.next({
            x: 11,
            h: false
        })
    })
    m.expect(stream).toBeObservable("a", vals)
}))

I don't want to a deep object compare between the emitted value and my test. I just want to test parts of the emitted value. In this case if x>=10. Is that possible with .toBeObservable? i.e.

m.expect(stream).toBeObservable("a", (vals)=>{
    if(vals['a']['x']<10) throw 'bad x' 
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant