apigee-127 / swagger-node-runner

The heart of Swagger-Node
MIT License
102 stars 123 forks source link

mockControllersDirs as config option #123

Closed penx closed 6 years ago

penx commented 6 years ago

The following comment in the code:

https://github.com/theganyo/swagger-node-runner/blob/7f85797e74ee8a182ae9458ac8e2eb4db9c7a6c3/index.js#L16-L22

Suggests you can pass in mockControllersDirs as a config option. However, there is no reference to config.mockControllersDirs in the code.

I guess this is either a missing feature or redundant comment.

Personally, I would find the feature useful. i.e. if mockControllersDirs is passed in as a config option, then the following lines:

https://github.com/theganyo/swagger-node-runner/blob/7f85797e74ee8a182ae9458ac8e2eb4db9c7a6c3/index.js#L174-L182

...should update config.bagpipes._router.mockControllersDirs to equal the passed in config. mockControllersDirs

penx commented 6 years ago

Looks like this can be done using:

  Runner.create({
    bagpipes: {
      _router: {
        mockControllersDirs: ['my-mock-dir']
      }
    }
  });