gherkin-jest
gherkin-jest copied to clipboard
fail is not defined in `process.ts`
Currently the process function in process.ts looks like this:
try {
return transformer.transform(filename, source);
} catch (e) {
if (e.name === 'SyntaxError' && e.location) {
fail(`${filename} (${e.location.start.line}, ${e.location.start.column}): ${e.message}`)
} else {
fail(`${e.name}: ${e.message}`)
}
fail is undefined and I'm not sure what it should be. In a jest sense there is not fail so I'm throwing instead.
try {
return transformer.transform(filename, source);
} catch (e) {
if (e.name === 'SyntaxError' && e.location) {
throw new Error(`${filename} (${e.location.start.line}, ${e.location.start.column}): ${e.message}`)
} else {
throw new Error(`${e.name}: ${e.message}`)
}
}
I'm probably missing something so feel free to ignore this PR for a better fix.
Getting this error as well and also noticed that fail is being called without being defined anywhere. I changed my Gherkin (that I thought was valid) until I stopped getting this error, but it would be nice to see this addressed so the actual Gherkin syntax errors are shown.
fail was defined in jest / jasmine - I suppose they must have changed something, because it definitely worked before. I'll have a look, thanks :)
There is done.fail but no fail.