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.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

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 year ago

Package Health Score

60 / 100
Full package analysis