/**
* Parrot.js
*
* @description :: The set of parrots registered in our app.
* @docs :: http://sailsjs.com/documentation/concepts/models-and-orm/models
*/
module.exports = {
attributes: {
// e.g. "Polly"
name: {
type: 'string'
},
// e.g. 3.26
wingspan: {
type: 'number',
required: true,
columnType: 'FLOAT'
},
// e.g. "cm"
wingspanUnits: {
type: 'string',
isIn: ['cm', 'in', 'm', 'mm'],
defaultsTo: 'cm'
},
// e.g. [{...}, {...}, ...]
knownDialects: {
collection: 'Dialect'
}
}
};
Created
February 16, 2017 18:36
-
-
Save rachaelshaw/f5bf442b2171154aa6021846d1a250f8 to your computer and use it in GitHub Desktop.
An example model definition for the Sails framework documentation - http://sailsjs.com/documentation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the best testing library for a sails server?
If I had multiple Parrot.js how could I write a test using playwright, jest, or mocha and have the test start with an empty Parrot.js and then fill the model with data and verify the data is valid?
Here is what I have using mocha (I like Jest and Playwright, but can settle for Mocha if it works)
I am getting errors that null is undefined and that sails is undefined. The purpose is that I am trying to understand if I can use Jest, Playwright, or Mocha to test functionality of a sails server using the models for the data types and using a helper script that has the .create() in it and keeping the ability to use sails.helpers.xx. Been at it for hours back and forth and no luck. Any recommendations?