I'm using cypress 9.3.1
with @cypress/code-coverage 3.9.12
and cypress-cucumber-preprocessor 4.3.1
in an angular 13.0.1
application.
My tests are running fine and also the code coverage is collected, but in the afterAll hook I get an error TypeError: elm[aelFn] is not a function
. I have no idea where it is coming from.
I am using ngx-build-plus 13.0.1
to serve the angular app with an extraWebpackConf, but even if I use the 'regular' @angular-devkit/build-angular:dev-server
the error message appears at the end of my tests (the code is not instrumented then).
My plugin/index.ts
:
const browserify = require('@cypress/browserify-preprocessor');
const cucumber = require('cypress-cucumber-preprocessor').default;
const path = require('path');
export default (on: Cypress.PluginEvents, config: Cypress.PluginConfigOptions): Cypress.PluginConfigOptions => {
// code coverage plugin
require('@cypress/code-coverage/task')(on, config);
// cucumber plugin
const options = {
...browserify.defaultOptions,
typescript: path.resolve('node_modules/typescript'),
};
on('file:preprocessor', cucumber(options));
return config;
};
You can see a screenshot of the error below:
[
EDIT: even when I remove the cypress code coverage plugin the error still occurs.