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

TypeError: Cannot read property 'add' of undefined #197

Open
vladbushev opened this issue Jul 12, 2020 · 1 comment
Open

TypeError: Cannot read property 'add' of undefined #197

vladbushev opened this issue Jul 12, 2020 · 1 comment

Comments

@vladbushev
Copy link

vladbushev commented Jul 12, 2020

I want check what if method service.create runed then method storeService.setType run with null.
I have method service.create he return service.createItem$. service.createItem$ return apiService.create$
In unit

when(apiService.create$(TestDataFactory.createData('AAA')))
            .thenReturn(of(TestDataFactory.createData('AAA')));

 when(service.createItem$(TestDataFactory.createData('AAA')))
            .thenReturn(of(TestDataFactory.createData('AAA')));
it('should create', fakeAsync(() => {
            service.create(TestDataFactory.createData('AAA'));

            expect(storeService.setType).toHaveBeenCalledWith(null);
        }));

@matyx
Copy link

matyx commented Jul 21, 2020

Can you provide full example? I cant figure out what are you trying to do...

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

2 participants