How to use the unexpected.use function in unexpected

To help you get started, we’ve selected a few unexpected examples, based on popular ways it is used in public projects.

github mickhansen / dataloader-sequelize / resources / mocha-bootload.js View on Github external
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
github lightninglabs / lightning-app / test / setup.js View on Github external
import expect from 'unexpected';
import unexpectedSinon from 'unexpected-sinon';
import sinon from 'sinon';

expect.use(unexpectedSinon);

global.expect = expect;
global.sinon = sinon;

unexpected

Extensible BDD assertion toolkit

MIT
Latest version published 1 month ago

Package Health Score

81 / 100
Full package analysis

Similar packages