Socket
Socket
Sign inDemoInstall

sails-scuttlebutt

Package Overview
Dependencies
141
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sails-scuttlebutt

Hard fork of sails-disk. Adapter for providing fixtures when testing SailsJS 1.X.X applications.


Version published
Weekly downloads
1
decreased by-80%
Maintainers
1
Install size
11.3 MB
Created
Weekly downloads
 

Readme

Source

sails-scuttlebutt

A hard fork of sails-disk.

A local disk adapter and fixture provider for the Sails framework and Waterline ORM. Bundled with the sails-hook-orm hook.

Usage

First, register sails-scuttlebutt as an adapter in your datastore config.

module.exports.datastores = {
  test: {
    adapter: 'sails-scuttlebutt',
    dir: './test/fixtures'
  }
};

When the adapter loads, it will attempt to load a file named modelName.json for each model in your app from the directory dir. dir defaults to ./test/fictures. In /env/test.js, override your dev/prod datastore config:

module.exports = {
  models: {
    datastore: 'test'
  }
};

Finally, run your tests and specify the environment:

NODE_ENV=test npm run tests;

Since your fixture data is populated directly instead of being added using Model.create(), sails-specific hooks won't take effect (e.g. beforeCreate or auto-incrementing IDs). You'll need to account for that in your fixture data.

Under the hood, this uses nedb.

License

This package, like the Sails framework, is free and open-source under the MIT License.

Keywords

FAQs

Last updated on 25 Jan 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc