bredikhin / barrels

Simple DB Fixtures for Sails.js
MIT License
85 stars 34 forks source link

Specify custom directory for fixtures #35

Closed dmvianna closed 9 years ago

dmvianna commented 9 years ago

I am trying to test both server and client code. So the obvious directory structure would be:

./myApp
├── api
├── assets
├── ...
├── test
│  ├── server
│  │  ├── unit
│  │  │  ├── controllers
│  │  │  │  └── UsersController.test.js
│  │  │  ├── models
│  │  │  │  └── Users.test.js
│  │  │  └── ...
│  │  ├── fixtures
│  │  ├── ...
│  │  ├── bootstrap.test.js
│  │  └── mocha.opts
│  └──  client
│       ├── unit
│       ├── ...
│       ├── karma.conf.js
│       ├── test.main.js
│       └── mocha.opts
└── views

Is it currently possible? Barrels seems to want fixtures to be in ./myApp/test/fixtures, and there is no documentation about how to change that.

EDIT: Not a big issue, as leaving the fixtures directory where it is expected to be and using

    "test": "NODE_ENV=test mocha test/server -R spec -b --recursive"

in package.json is enough to run npm test successfully, at least for the server tests. It is just that I prefer to put things where they belong.

bredikhin commented 9 years ago

https://github.com/bredikhin/barrels/blob/master/index.js#L20