Lets look at an example:
The Step Definitions
1 2 3 4 5 6 7 8 9 10 11 12
Given the following folder structure:
my_js_project/lib/code_lives_here.js my_js_project/features/support/env.js my_js_project/features/my_feature.feature
Within our features/support/env.js setup file we would have:
The code within code_lives_here.js would be availabe in the step definitions.
You can see the full example in the Cucumber project: