microsoft / botbuilder-utils-js

Utilities and middleware for the Microsoft Bot Framework
MIT License
30 stars 12 forks source link

Figure out way to automate finding the correct playback directory #50

Open roalexan opened 6 years ago

roalexan commented 6 years ago

As of now, we're instructing our users to always construct HttpTestPlayback with 'testDataDirectory', otherwise it defaults to, for example: C:\microsoft\repos\bots\samples\testplayback\javascript\node_modules\mocha\bin\test\data\

However, it might be nice if an empty constructor could be used, and the code defaults to the directory of the project, not 'node_modules\mocha\bin'.

ctstone commented 6 years ago

I think we can take a trial and error approach:

  1. look in current directory
  2. look in root package directory (gets weird when mocha is invoked on command line)
  3. keep looking in parent directory until parents are exhausted