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

Type of matchers is incorrect when Cypress is installed #863

Closed
ivibe opened this issue Oct 31, 2018 · 3 comments
Closed

Type of matchers is incorrect when Cypress is installed #863

ivibe opened this issue Oct 31, 2018 · 3 comments
Labels

Comments

@ivibe
Copy link

ivibe commented Oct 31, 2018

Greetings!

OS: Windows 10 64bit
@nrwl/[email protected]
VS Code 1.28.2
Typescript 3.1.3

Created new workspace from scratch
create-nx-workspace myworkspacename
after created new project
ng g app myapp
chose Cypress and Jest as E2E Test Runner and Unit Test Runner, respectively.

In file
myworkspacename/apps/myapp/src/app/app.component.spec.ts
get Typescript errors, for example
[ts] Property 'toBeTruthy' does not exist on type 'Assertion'.
because 'expect' corresponds to 'coChai.ExpectStatic' and not 'jest.Expect'

When I add /// <reference types="jest" /> at the beginng of the file, the errors are gone.

Is it bug or I do something wrong?

@skydever
Copy link
Contributor

seems related to #816 ... maybe removing the global types at tsconfig and explicitly importing from the test lib you are using at the test could be an option? somehow I am not sure why it is not done with an import instead of using global typings, what are the reasons for this? sorry for not trying it out yet, just thinking about this ... to keep tests simple, no worries about imports? maybe I overlooked something, sorry for that ...

@ivibe
Copy link
Author

ivibe commented Nov 1, 2018

I was inspired by cypress test file
myworkspacename/apps/myapp-e2e/src/integration/app.spec.ts
, where
/// <reference types="cypress" />
is set.
Anyway, you are right. It's a dupe of #816, sorry for that :)

@ivibe ivibe closed this as completed Nov 1, 2018
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants