AC
- cypress tests run in MediaWiki-Quickstart (Docker)
Local
Running locally, I'm getting errors (see T384032 and P87990).
1) An uncaught error was detected outside of a test:
TypeError: The following error originated from your test code, not from Cypress.
> Object prototype may only be an Object or null: undefined
When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.
Cypress could not associate this error to any specific test.
We dynamically generated a new test to display this failure.
at Function.setPrototypeOf (<anonymous>)
at ../../node_modules/supertest/lib/agent.js (webpack://wikibase/../../node_modules/supertest/lib/agent.js:53:0)
at __webpack_require__ (webpack://wikibase/webpack/bootstrap:19:0)
at ../../node_modules/supertest/index.js (webpack://wikibase/../../node_modules/supertest/index.js:14:14)
at __webpack_require__ (webpack://wikibase/webpack/bootstrap:19:0)
at ../../node_modules/api-testing/lib/actionapi.js (webpack://wikibase/../../node_modules/api-testing/lib/actionapi.js:4:18)
at __webpack_require__ (webpack://wikibase/webpack/bootstrap:19:0)
at ../../node_modules/api-testing/lib/action_clients.js (webpack://wikibase/../../node_modules/api-testing/lib/action_clients.js:4:15)
at __webpack_require__ (webpack://wikibase/webpack/bootstrap:19:0)
at ../../node_modules/api-testing/index.js (webpack://wikibase/../../node_modules/api-testing/index.js:4:9)Screenshots are all similar.
CI
In CI, the errors are different than when running locally (see T384032 and P87989).
Oops...we found an error preparing this test file:
> cypress/e2e/wbui2025/RTLLanguages.cy.ts
The error was:
Error: You are attempting to run a TypeScript file, but do not have TypeScript installed. Ensure you have 'typescript' installed to enable TypeScript support.
The file: /var/www/html/w/extensions/Wikibase/cypress/e2e/wbui2025/RTLLanguages.cy.ts
at Object.handler (/var/www/html/w/extensions/Wikibase/cypress/.cache/14.5.4/Cypress/resources/app/node_modules/@packages/server/node_modules/@cypress/webpack-batteries-included-preprocessor/index.js:197:29)
at invoke (/var/www/html/w/extensions/Wikibase/cypress/.cache/14.5.4/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:189:18)
at /var/www/html/w/extensions/Wikibase/cypress/.cache/14.5.4/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:59:14
at tryCatcher (/var/www/html/w/extensions/Wikibase/cypress/.cache/14.5.4/Cypress/resources/app/node_modules/bluebird/js/release/util.js:16:23)
at Promise.attempt.Promise.try (/var/www/html/w/extensions/Wikibase/cypress/.cache/14.5.4/Cypress/resources/app/node_modules/bluebird/js/release/method.js:39:29)
at Object.wrapChildPromise (/var/www/html/w/extensions/Wikibase/cypress/.cache/14.5.4/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:58:23)
at Object.wrap (/var/www/html/w/extensions/Wikibase/cypress/.cache/14.5.4/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/preprocessor.js:47:8)
at RunPlugins.execute (/var/www/html/w/extensions/Wikibase/cypress/.cache/14.5.4/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:161:29)
at EventEmitter.<anonymous> (/var/www/html/w/extensions/Wikibase/cypress/.cache/14.5.4/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:56:12)
at EventEmitter.emit (node:events:524:28)
at process.<anonymous> (/var/www/html/w/extensions/Wikibase/cypress/.cache/14.5.4/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)
at process.emit (node:events:524:28)
at emit (node:internal/child_process:950:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
- A missing file or dependency
- A syntax error in the file or one of its dependencies
Fix the error in your code and re-run your tests.