You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.
I have tracked this down to be caused by the way the TypeScript transform is added to the transforms that are already present (i.e. this code and specifically lines 120 and 139).
I don't think this bug is specific to the Cucumber preprocessor.
I'm not that familiar with Browserify, but according to its documentationtransform can be "an array of transform functions or modules names which will transform the source code before the parsing". The mentioned lines, incorrectly, assume the transform property is always an array of arrays where the first entry in each array is a string specifying the path to a transform. This causes either the destructuring to fail or causes includes being called on undefined, I haven't dug that deep.
Adjusting the offending lines to something along the lines of
respectively results in the desired behavior. A quick test using a default value for the destructuring (i.e. ([name = ''])) does not appear to solve the issue.
Desired behavior:
Transforms defined directly as functions should work.
Is this a Feature or Bug?
This is a bug.
Current behavior:
When trying to use https://github.com/TheBrainFamily/cypress-cucumber-preprocessor combined with the out-of-the-box TypeScript support, running any type of test results in
TypeError: undefined is not a function
.I have tracked this down to be caused by the way the TypeScript transform is added to the transforms that are already present (i.e. this code and specifically lines 120 and 139).
I don't think this bug is specific to the Cucumber preprocessor.
I'm not that familiar with Browserify, but according to its documentation
transform
can be "an array of transform functions or modules names which will transform the source code before the parsing". The mentioned lines, incorrectly, assume thetransform
property is always an array of arrays where the first entry in each array is a string specifying the path to a transform. This causes either the destructuring to fail or causesincludes
being called onundefined
, I haven't dug that deep.Adjusting the offending lines to something along the lines of
and
respectively results in the desired behavior. A quick test using a default value for the destructuring (i.e.
([name = ''])
) does not appear to solve the issue.Desired behavior:
Transforms defined directly as functions should work.
How to reproduce:
In a basic Cypress setup:
npm install cypress-cucumber-preprocessor
cypress/plugins/index.js
containing:The text was updated successfully, but these errors were encountered: