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

import json cause the Cypress to crash #104

Open
zshlomyz opened this issue Dec 29, 2019 · 0 comments
Open

import json cause the Cypress to crash #104

zshlomyz opened this issue Dec 29, 2019 · 0 comments

Comments

@zshlomyz
Copy link

zshlomyz commented Dec 29, 2019

Hi,
I want to assert that the visual content match to the data from the server.
For that i made a few things:

  1. Import a json file (import assetsMock from '../../fixtures/assets.json')
  2. Use it as the response of cy.route
  3. Asset that some DOM element contain the same data

I just added this package in order to write test using typescript.
Now - the import statement cause Cypress to crash with this error:

Error running plugin

The following error was thrown by a plugin. We've stopped running your tests because a plugin crashed.

./cypress/integration/infrastructure/assets.ts
Module build failed (from ./node_modules/ts-loader/index.js):
Error: Debug Failure. File C:\cypress_typescript_test\cypress\fixtures\assets.json has unknown extension.
at Object.extensionFromPath (C:\cypress_typescript_test\node_modules\typescript\lib\typescript.js:4694:15)
at C:\cypress_typescript_test\node_modules\typescript\lib\typescript.js:78448:46
at Array.map ()
at resolveModuleNamesWorker (C:\cypress_typescript_test\node_modules\typescript\lib\typescript.js:78442:195)
at resolveModuleNamesReusingOldState (C:\cypress_typescript_test\node_modules\typescript\lib\typescript.js:78703:19)
at processImportedModules (C:\cypress_typescript_test\node_modules\typescript\lib\typescript.js:79804:35)
at findSourceFile (C:\cypress_typescript_test\node_modules\typescript\lib\typescript.js:79696:17)
at C:\cypress_typescript_test\node_modules\typescript\lib\typescript.js:79567:85
at getSourceFileFromReferenceWorker (C:\cypress_typescript_test\node_modules\typescript\lib\typescript.js:79534:34)
at processSourceFile (C:\cypress_typescript_test\node_modules\typescript\lib\typescript.js:79567:13)
at processRootFile (C:\cypress_typescript_test\node_modules\typescript\lib\typescript.js:79414:13)
at C:\cypress_typescript_test\node_modules\typescript\lib\typescript.js:78497:60
at Object.forEach (C:\cypress_typescript_test\node_modules\typescript\lib\typescript.js:1792:30)
at Object.createProgram (C:\cypress_typescript_test\node_modules\typescript\lib\typescript.js:78497:16)
at synchronizeHostData (C:\cypress_typescript_test\node_modules\typescript\lib\typescript.js:107641:26)
at Object.getProgram (C:\cypress_typescript_test\node_modules\typescript\lib\typescript.js:107723:13)
at Object.ensureProgram (C:\cypress_typescript_test\node_modules\ts-loader\dist\utils.js:177:41)
at Object.getEmitOutput (C:\cypress_typescript_test\node_modules\ts-loader\dist\instances.js:178:29)
at getEmit (C:\cypress_typescript_test\node_modules\ts-loader\dist\index.js:242:37)
at successLoader (C:\cypress_typescript_test\node_modules\ts-loader\dist\index.js:67:15)
at Object.loader (C:\cypress_typescript_test\node_modules\ts-loader\dist\index.js:22:12)
@ multi ./cypress/integration/infrastructure/assets.ts main[0]

Please help

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

1 participant