jest-cucumber
jest-cucumber copied to clipboard
autoBindSteps - Your test suite must contain at least one test.
Hi, i'm running the ecmascript example you have for autobindsteps and i keep on getting the same error from Jest
https://github.com/bencompton/jest-cucumber/blob/master/examples/ecmascript/specs/step-definitions/auto-step-binding.steps.js
Jest version : 27.5.1 Jest-Cucumber version : 6.1.0
Command used : jest --config jest-feature-config.js
jest-feature-config.js :
module.exports = { testMatch: ["**/my.steps.js"] };
my.steps.js :
import { loadFeatures, autoBindSteps } from "jest-cucumber";
export const vendingMachineSteps = ({ given, and, when, then }) => {
given(/^the vending machine has "(.*)" in stock$/, itemName => {
console.log('given');
});
and("I have inserted the correct amount of money", () => { console.log('and'); });
when(/^I purchase "(.*)"$/, itemName => { console.log('when'); });
then(/^my "(.*)" should be dispensed$/, itemName => { console.log('then'); }); };
const features = loadFeatures("./my.feature");
autoBindSteps(features, [vendingMachineSteps]);
my.feature :
Feature: Snack vending machine
Scenario: Purchasing a snack
Given the vending machine has "Maltesers" in stock
And I have inserted the correct amount of money
When I purchase "Maltesers"
Then my "Maltesers" should be dispensed
Error :
● Test suite failed to run
Your test suite must contain at least one test.
at onResult (node_modules/jest-cli/node_modules/@jest/core/build/TestScheduler.js:175:18)
at node_modules/emittery/index.js:260:13
at Array.map (<anonymous>)
at Emittery.emit (node_modules/emittery/index.js:258:23)
Any idea why this is happening and how to fix it ? I've tried in many ways and always get the same result. This is really blocking and i don't understand why it's not working properly, Thanks
Hi,
in my modest opinion, this line:
const features = loadFeatures("./my.feature");
is not finding the Feature File.
Try to verify the file location.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue is closed because there has been no recent activity.