ngneat / spectator

🦊 🚀 A Powerful Tool to Simplify Your Angular Tests

Home Page:https://ngneat.github.io/spectator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

inject does not find directive provider

ccosmincc opened this issue · comments

Is this a regression?

No

Description

Using the inject function for retrieving directive providers throws "No provider for ..." error.
This can be reproduced by adding the following test in this file:

it('should retrieve provider', () => {
    host = createHost();
    const provider = host.inject(directiveProviderToken, true); // this line will throw "No provider for ... error"
    expect(provider).toBeDefined();
});

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in

spectator v15.0.1
angular v16.1.0

Anything else?

No response

Do you want to create a pull request?

No