I have been using cypress-cucumber-preprocessor with cypress and typescript. While exploring the custom parameter types feature, I came across a possibility to define custom parameter types in my step definitions file.
However, I am facing challenges when trying to run it with Typescript. The interface in TypeScript is defined as
export function defineParameterType(): void;
, which makes it difficult for me to write a proper definition when importing the module.
When I tried implementing it in JavaScript, following the example provided, I encountered an error:
Uncaught Error: Undefined parameter type {boolean}
My JavaScript code snippet looks like this:
defineParameterType({
name: "boolean",
regexp: /true|false/,
transformer(s) {
return s === 'true';
}
});
Is there a workaround to make it work seamlessly with Typescript?