Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
require("babel-register");
var unexpected = require('unexpected');
unexpected.use(require('unexpected-sinon'));
unexpected.use(require('unexpected-set'));
var Bluebird = require('bluebird');
require('sinon-as-promised')(Bluebird);
var Sequelize = require('sequelize');
unexpected.addType({
name: 'Sequelize.Instance',
identify: /^[45]/.test(Sequelize.version) ?
function (value) {
return value && value instanceof Sequelize.Model && 'isNewRecord' in value;
} :
function (value) {
return value && value instanceof Sequelize.Instance;
},
inspect: function (value, depth, output, inspect) {
const name = value.name || value.$modelOptions.name || value._modelOptions.name; // v3 vs v4
import expect from 'unexpected';
import unexpectedSinon from 'unexpected-sinon';
import sinon from 'sinon';
expect.use(unexpectedSinon);
global.expect = expect;
global.sinon = sinon;