This repository was archived by the owner on Nov 8, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,10 @@ const {
1616} = require ( 'cucumber' ) ;
1717
1818
19- const DREDD_BIN = path . join ( process . cwd ( ) , 'node_modules' , '.bin' , 'dredd' ) ;
20-
21-
2219Before ( function hook ( ) {
2320 this . dir = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , 'dredd-hooks-template-' ) ) ;
21+ this . dreddBin = path . join ( process . cwd ( ) , 'node_modules' , '.bin' , 'dredd' ) ;
2422 this . env = { ...process . env } ;
25- this . commands = [ ] ;
2623 this . dataSent = '' ;
2724} ) ;
2825
@@ -32,8 +29,8 @@ After(async function hook() {
3229} ) ;
3330
3431
35- Given ( 'I have Dredd installed' , ( ) => {
36- which . sync ( DREDD_BIN ) ; // throws if not found
32+ Given ( 'I have Dredd installed' , function step ( ) {
33+ which . sync ( this . dreddBin ) ; // throws if not found
3734} ) ;
3835
3936Given ( / ^ a f i l e n a m e d " ( [ ^ " ] + ) " w i t h : $ / , function step ( filename , content ) {
@@ -46,7 +43,7 @@ Given(/^I set the environment variables to:$/, function step(env) {
4643
4744
4845When ( / ^ I r u n ` d r e d d ( [ ^ ` ] + ) ` $ / , function step ( args ) {
49- this . proc = childProcess . spawnSync ( `${ DREDD_BIN } ${ args } ` , [ ] , {
46+ this . proc = childProcess . spawnSync ( `${ this . dreddBin } ${ args } ` , [ ] , {
5047 shell : true ,
5148 cwd : this . dir ,
5249 env : this . env ,
You can’t perform that action at this time.
0 commit comments