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"

本文标签: