Cypress nu eșuează la eroarea de compilare TypeScript
Am creat un nou proiect Cypress, am rulat yarn run cypress open, am adăugat tsconfig.json așa cum este descris în https://docs.cypress.io/guides/tooling/typescript-support, am schimbat extensia fișierului integration/1-getting-started/todo.spec.js în .ts. Pot rula testele și să văd erori TS în VS Code. Problema este că, chiar dacă codul TS are cu siguranță erori, testele sunt în continuare rulate (și pot să treacă!). Am încercat să adaug "noEmitOnError": true la "compilerOptions", dar acest lucru nu pare să aibă efect (poate folosește fișiere emise anterior?).
Dacă rulez manual npx tsc, nu primesc doar erorile așteptate în propriul meu cod (ultima), ci și câteva erori în tipurile cypress:
alexey@DESKTOP-41AVESA:~/shaka/popmenu/spec/cypress-ts$ npx tsc
../../node_modules/cypress/types/cy-blob-util.d.ts:6:27 - error TS2792: Cannot find module 'blob-util'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?
6 import * as blobUtil from 'blob-util'
~~~~~~~~~~~
../../node_modules/cypress/types/cy-bluebird.d.ts:4:35 - error TS2792: Cannot find module './bluebird'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?
4 import ImportedBluebird = require('./bluebird')
~~~~~~~~~~~~
../../node_modules/cypress/types/cypress-eventemitter.d.ts:2:29 - error TS2792: Cannot find module 'eventemitter2'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?
2 type EventEmitter2 = import("eventemitter2").EventEmitter2
~~~~~~~~~~~~~~~
../../node_modules/cypress/types/cypress-eventemitter.d.ts:33:33 - error TS2792: Cannot find module 'buffer/'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?
33 type BufferType = typeof import("buffer/").Buffer
~~~~~~~~~
../../node_modules/cypress/types/sinon-chai/index.d.ts:12:24 - error TS2792: Cannot find module '../sinon'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?
12 import * as Sinon from '../sinon';
~~~~~~~~~~
cypress/integration/1-getting-started/todo.spec.ts:14:7 - error TS2322: Type 'string' is not assignable to type 'number'.
14 const message: number = "Hello World"
~~~~~~~
Versiunea Cypress: 9.5.4
Versiunea TypeScript: 4.6.3