You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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 ...
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 :)
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?
The text was updated successfully, but these errors were encountered: