const Model = require('objection').Model;
class User extends Model {
static get tableName() {
return 'user';
}
static get jsonSchema() {
return {
type: 'object',
required: ['name', 'address'],
properties: {
id: { type: 'integer' },
name: { type: 'string', minLength: 1, maxLength: 255 },
address: { type: 'string', minLength: 1, maxLength: 255 },
},
};
}
}
module.exports = User;
And I want to make some unit test such as verify the insertion of a new user of read a user from a database.