title: Proper usage of cucumber with typescript?
body: <p>I was following a <a href="https://sylvain.pontoreau.com/2018/04/30/typescript-cucumber-getting-started/" rel="noreferrer">tutorial</a> but the setup is really bad. Basically it uses typescript to convert .ts files to .js. So basically pollutes your whole source code with .js files around.</p>
  
  <p>So as soon as you import your .ts file from source code, all dependencies are duplicated with a .js file. </p>
  
  <p>Do you know how to do proper typescript cucumber tests?</p>
  
  <p>A hacky solution: Copy all features and all files to another temp folder, run from there. I would expect cucumber to be a bit more mature than this, hence my question here?</p>
  
  <p>Or change the configuration of cucumber to look in the build folder from ts.</p>
  
  <p>Thank you</p>
  
  <h1>Why just using typescript won't work:</h1>
  
  <p>Code structure:</p>
  
  <ul>
  <li>tests
  
  <ul>
  <li>a.feature</li>
  <li>stepDefinitions.ts</li>
  </ul></li>
  </ul>
  
  <p>Now you will compile the typescript and have this structure:</p>
  
  <ul>
  <li>tests
  
  <ul>
  <li>a.feature</li>
  <li>stepDefinitions.ts</li>
  </ul></li>
  <li>build
  
  <ul>
  <li>tests
  
  <ul>
  <li>stepDefinitions.js</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>Now you can see that <code>stepDefinitions.js</code> has no idea where to find <code>a.feature</code>. If you run cucumber on the build/test folder it won't find any step feature to run... because well, they are in the tests folder. So the hacky way to fix it is to copy over the features files resulting this structure:</p>
  
  <ul>
  <li>tests
  
  <ul>
  <li>a.feature</li>
  <li>stepDefinitions.ts</li>
  </ul></li>
  <li>build
  
  <ul>
  <li>tests
  
  <ul>
  <li>a.feature</li>
  <li>stepDefinitions.js</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>Now it will work but is hacky, I don't like it.</p>