GithubHelp home page GithubHelp logo

goinstant / assert Goto Github PK

View Code? Open in Web Editor NEW
8.0 36.0 0.0 20 KB

node and browser (IE8+) compatible assertion library

License: BSD 3-Clause "New" or "Revised" License

JavaScript 99.92% CSS 0.08%

assert's Introduction

Assert

Build Status Coverage Status Dependency Status

A last-resort, legacy browser and node compatible, assert library.

Implements all of Chai.js Assert functions except for .deepProperty and the deepProperty-related functions.

assert.throws has been renamed to assert.exception and assert.noException.

assert.ifError is included as an alias of notOk for expressively testing for the non-presence of errors.

assert's People

Contributors

adamwdennis avatar bendecoste avatar ianlivingstone avatar jbowes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

assert's Issues

exports is not defined when running instanceOf in browser

ReferenceError: exports is not defined
    at formatValue (http://localhost:5050/node_modules/goinstant-assert/index.js:502:25)
    at inspect (http://localhost:5050/node_modules/goinstant-assert/index.js:465:10)
    at objectDisplay (http://localhost:5050/node_modules/goinstant-assert/index.js:437:13)
    at new AssertionError (http://localhost:5050/node_modules/goinstant-assert/index.js:21:32)
    at fancyFail (http://localhost:5050/node_modules/goinstant-assert/index.js:72:9)
    at Function.assert.instanceOf (http://localhost:5050/node_modules/goinstant-assert/index.js:250:5)
function formatValue(ctx, value, recurseTimes) {
  // Provide a hook for user-specified inspect functions.
  // Check that value is an object with an inspect function on it
  if (value && typeof value.inspect === 'function' &&
      // Filter out the util module, it's inspect function is special
      value.inspect !== exports.inspect &&
      // Also filter out any prototype objects using the circular check.
      !(value.constructor && value.constructor.prototype === value)) {
    var ret = value.inspect(recurseTimes);
    if (typeof ret !== 'string') {
      ret = formatValue(ctx, ret, recurseTimes);
    }
    return ret;
  }

Update lodash

Lodash is pretty out of date. There are optimizations and bug fixes that assert is missing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.