admin管理员组文章数量:1199542
I upgraded to 3.0.7 and tested newer versions of allure-cypress plugin as well. When I run my test scripts, I get the following error:
Oops...we found an error preparing this test file: > cypress\support\e2e.ts The error was: SyntaxError: Unexpected token (1:16307) while parsing C:\Users\USER\allure-cypress\dist\cjs\index.js while parsing file: C:\Users\USER\node_modules\allure-cypress\dist\cjs\index.js at DestroyableTransform.end [as _flush]
(C:\Users\USER\node_modules\insert-module-globals\index.js:114:21)
at DestroyableTransform.prefinish (C:\Users\USER\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:138:10)
at DestroyableTransform.emit (node:events:513:28)
at DestroyableTransform.emit (node:domain:489:12)
at prefinish (C:\Users\USER\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:619:14)
at finishMaybe (C:\Users\USER\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:627:5)
at endWritable (C:\Users\USER\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:638:3)
at DestroyableTransform.Writable.end (C:\Users\USER\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:594:22)
at DestroyableTransform.onend (C:\Users\USER\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:577:10)
at Object.onceWrapper (node:events:627:28)
at DestroyableTransform.emit (node:events:525:35)
at DestroyableTransform.emit (node:domain:489:12)
at endReadableNT (C:\Users\USER\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:1010:12)
at processTicksAndRejections (node:internal/process/task_queues:82:21)"
Versions 3.0.5 and below work just fine. I'm using a cypress and cucumber framework and there are some fixes to some issues on the newer versions that I need for the report to include the proper test steps under the Test body. Within my e2e.ts file I'm importing the plugin:
import "allure-cypress"
I tried adding the path to the allure-cypress plugin and also to allow .js files within 'include' on the tsconfig.json file:
"include": [
"/*.ts",
"/*.js",
"./node_modules/cypress",
"./node_modules/allure-cypress/dist/cjs",
"./node_modules/allure-cypress"]
I also upgraded/ changed versions of the following plugins withing the package.json file to check if it was a compatibility issue:
"cucumber": "latest"
"@types/node": "latest"
"allure-cypress": "^3.0.9"
"typescript": "^5.4.5"
"cypress": "^13.17.0"
"@badeball/cypress-cucumber-preprocessor": "^20.0.6"
本文标签:
版权声明:本文标题:typescript - allure-cypress plugin version 3.0.7+ throws Unexpected token while parsing allure-cypressdistcjsindex.js - Stack Ov 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738526802a2092829.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论