Source code from Cypress on Rails
// spec/cypress/support/on-rails.ts
Cypress.Commands.add('app', function (name, command_options) {
return cy
.appCommands({ name: name, options: command_options })
.then((body) => {
return body[0];
});
});
spec/cypress/tsconfig.json
{
"compilerOptions": {
"strict": true,
"target": "es5",
"lib": ["es6", "dom"],
"module": "es6",
"moduleResolution": "node",
"sourceMap": false,
"types": ["cypress"],
"downlevelIteration": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
},
"include": ["**/*.ts"]
}
Results in
Property 'app' does not exist on type 'cy & EventEmitter'.