| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Hi, @jstnjs. Thanks for opening this! Can you tell me more what these changes pursue? |
Sorry, something went wrong.
|
Hi, I just realised something is still going wrong in the editor. I'll post an update somewhere this week with an overview of the changes I did. |
Sorry, something went wrong.
|
Hey @kettanaito I took a stab at fixing the issue you pointed out in the file. There are some strange behaviors at play. When you set up a clean Angular app and add Jest, everything works fine. But as soon as you add Cypress, the types in the editor start breaking (even though the tests run successfully). For instance, the editor throws this error: To resolve this, I excluded cypress.config.ts from tsconfig.json, as suggested here. That seemed to fix it... or so I thought. I created a custom CounterComponent to further test this, and whenever any kind of dependency injection is involved (via the inject function or a constructor), the types break again, causing test failures. After inspecting the testing-library package code, I noticed they included jest.config.ts and jest.setup.ts in tsconfig.spec.json, which resolved these issues. Another challenge: tests pass in the editor, but fail when running npm run test:integration. It seems they only succeed in the editor because they run one spec file at a time. When running multiple tests with test:integration, you get an error like this: ReferenceError: Response is not defined
> 1 | import { http, graphql, HttpResponse } from 'msw'
It appears this is due to the unavailability of the fetch API in jsdom (related issues: #930, #7007, and #13834). As per the MSW documentation, I added the jest-fixed-jsdom package to help address this. Summary of updates:
If you have any questions about specific details, let me know! |
Sorry, something went wrong.
|
I'm writing a article on MSW with Angular and just noticed something. The service worker script was included in the production bundle. I changed the config to include the script only in development. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Hi,
I like the project and always wanted to try update a plain angular project. Feel free to decline :)