gherkin-jest icon indicating copy to clipboard operation
gherkin-jest copied to clipboard

fail is not defined in `process.ts`

Open dagda1 opened this issue 7 years ago • 3 comments

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.

dagda1 avatar Feb 07 '18 14:02 dagda1

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.

bencompton avatar Feb 07 '18 20:02 bencompton

fail was defined in jest / jasmine - I suppose they must have changed something, because it definitely worked before. I'll have a look, thanks :)

sjmeverett avatar Feb 08 '18 12:02 sjmeverett

There is done.fail but no fail.

dagda1 avatar Feb 08 '18 16:02 dagda1