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

Support for Cypress #57

Open
azaeng04 opened this issue Jan 17, 2022 · 1 comment
Open

Support for Cypress #57

azaeng04 opened this issue Jan 17, 2022 · 1 comment

Comments

@azaeng04
Copy link

Is your feature request related to a problem? Please describe.
So I am using the following library: https://github.com/jscutlery/devkit to write component tests for Angular components.
A test is defined with the mount function like so:

mount(MyComponent, {
 providers: [],
...
})

Describe the solution you'd like
I would like to be able to make use of auto-spies to be able to mock out return values on services to verify different rendered states of the component visually.

So using this:


    let myServiceSpy: Spy<MyService>;
    provideAutoSpy(MyService),
    myServiceSpy = TestBed.inject<any>(MyService);

inside the

mount(MyComponent, {
 providers: [provideAutoSpy(MyService),],
...
})

and mock the return value later in the test

Describe alternatives you've considered
None

Additional context
When providing that auto-spy an error is thrown indicating that jasmine or jest is not defined. I am assuming here that we might need to make use of cypress mocking framework, which is Sinon under the hood.

@shairez
Copy link
Member

shairez commented Mar 3, 2022

Hi @azaeng04

In order to support cypress we first need to create a port of this library for mocha
I'm talking to Jordan Powell from the Cypress team and he needs to get back to me if he thinks it's a good fit

Will update

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