Code Monkey home page Code Monkey logo

expectations's People

Contributors

chrisskilton avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar fasttime avatar rotemdan avatar sgravrock avatar spmason avatar sublimino avatar

Stargazers

 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

Watchers

 avatar  avatar

expectations's Issues

formatValue infinite loop

expectations.js == index.js

Maximum call stack size exceeded
    at file://localhost/Users/wyuenho/Documents/workspace/backgrid/assets/js/expectations.js:74:71
    at Array.map (native)
    at formatValue (file://localhost/Users/wyuenho/Documents/workspace/backgrid/assets/js/expectations.js:73:39)
    at file://localhost/Users/wyuenho/Documents/workspace/backgrid/assets/js/expectations.js:74:34
    at Array.map (native)
    at formatValue (file://localhost/Users/wyuenho/Documents/workspace/backgrid/assets/js/expectations.js:73:39)
    at formatValue (file://localhost/Users/wyuenho/Documents/workspace/backgrid/assets/js/expectations.js:57:21)
    at file://localhost/Users/wyuenho/Documents/workspace/backgrid/assets/js/expectations.js:74:34
    at Array.map (native)
    at formatValue (file://localhost/Users/wyuenho/Documents/workspace/backgrid/assets/js/expectations.js:73:39)

not.toBeNull() and not.toThrow() message missing

The trick to switch the assertion.pass / assertion.fail methods for "not" chaining causes every assertion that does not assign arguments to the pass method to not show an error message. Affected are:

  • expect().not.toBeNull()
  • expect().not.toThrow()

Sincerely
Alex

toEqual() fails for subarrays of typed arrays on Android browser versions <=4.3

var a = new Uint8Array([2, 3]);
var b = new Uint8Array([2, 3]);
var c = new Uint8Array([1, 2, 3]);

expect(b).toEqual(a); // Works
expect(c.subarray(1)).toEqual(a); // Fails on Android browser <= 4.3

To fix this, typed arrays should be compared the same way regular arrays are, by elements and length only. It seems that on these versions of the Android browser, an additional property, such as 'offset' (just a suspicion) may also be compared (perhaps somewhere deeper in the object graph), causing the failure.

I don't really have the ability to debug this at the moment (there's no error console on android, and setting up remote debugging would take time). I've reproduced it using the Android Emulator on versions 4.0.3, 4.2.2 and 4.3.1 (earlier Android browser versions don't support typed arrays, I believe, so are not relevant). It did not happen on 4.4.2, 5.0.2 or 6.0 or any other browser that I've tried (I have not really tested it on mobile or desktop Safari though).

A rough fix (for Uint8Array only - just for demonstration). I changed line 143 from:

if (className == '[object Array]')

to

if (className == '[object Array]' || className == '[object Uint8Array]')

Needs a README and/or some doc

You are awesome. I hate expect.js and Chai's expect(yourMum).to.be.a.woman() style of matchers. Too much typing and namespace abuse. You've managed to port Jasmine's entire set of default matchers to Mocha. I salute you.

I believe this project deserve a whole lot more stars then it does now. I think it probably has to do with the lack of documentation. I've managed to painlessly integrate this package into my test harness, but other people might not be able to figure this out. What do you think?

Add travis ci

It's excellent that you already have good test coverage, but CI on pull requests would be the icing on the cake.

spys and mocks

Jasmine has a very simple spy and mock facility, it would be nice if this library could incorporate that.

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.