-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 2.0.12 Is not generating errors on the console. #63
Comments
I think this is the same issues I'm seeing. When expect fails, the exception is swallowed and the console just points the failure at test() without any useful output (eg. expected x but received y). only workaround is as mentioned above, to wrap the expect in try/catch |
There might be a regression or a change of behavior, 2.0.11 would point to which part of the test failed (ie. given), but 2.0.12 point to the overall test. For my same code and error, 2.0.11 would return
while 2.0.12 now returns |
@nguillemin and @sibyldawn I'm trying to reproduce this by creating a simple test that fails:
Feature: Test feature
Scenario: My test
Given my given step
import { loadFeature, defineFeature } from 'jest-cucumber';
const feature = loadFeature('./specs/features/test.feature');
defineFeature(feature, (test) => {
test('My test', ({ given }) => {
given('my given step', () => {
expect(true).toBe(false);
});
});
});
{
"name": "test",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "jest"
},
"devDependencies": {
"@babel/core": "^7.8.6",
"@babel/preset-env": "^7.8.6",
"babel-jest": "^25.1.0",
"jest-cucumber": "2.0.12"
},
"jest": {
"clearMocks": true,
"testEnvironment": "node",
"testMatch": [
"**/*.steps.js"
]
}
}
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current',
},
},
],
],
}; but it fails with, I believe, the expected information:
I'm using version 2.0.12 from npm. Is your setup different? |
@bencompton First of all, kudos on adding a reporting in json! I noticed when I run my test and it has errors, I only see that it failed but I don't see any error messages on my console, so it's hard to debug my test. The way I go around is by adding try-catches to log the errors, but it also passes the test even though it failed the assertion. I'm not sure if this is a known error but would love to know if there's a configuration I could do to force the reporter to log errors.
The text was updated successfully, but these errors were encountered: