Code Monkey home page Code Monkey logo

format's People

Contributors

btd avatar mrtbld avatar notslang avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

timmckenzie

format's Issues

Objects are fully traversed

As it stands, when an object is formatted, it is fully traversed. This causes OOM errors when we have very large objects to test.

Also, as mentioned in this issue shouldjs/should.js##108, some objects are too big for a print to be useful, and a behavior of max depth would be very useful.

Furthermore, as of node v7, the behavior of captureStackTrace has changed, it no longer lazy loads the stacktrace. This means that the formatter is always called when an AssertionError is reached, even in the case of a negated chain.

Custom Formatters

Hi,

I am using Should for an internal testing framework. We primarily do checks on JSDOM HTML DOM objects. If we get a Should exception, the resulting AssertionError#message is typically around 5MB, which is way to big. I would like to be able to define custom formatters for custom types in Should. I can create a formatting function internal to our testing framework, but would prefer with to Should/format.

I see that I can add custom formatters. However, should/type does not have any method for adding custom types. Also in Should/type, the module.exports is overwritten with the getType method. Changes to have custom types in should/type would cause breaking changes to Should.

Are custom formatters and custom the type detection on the road map for Should?
Can they be added?
Would a pull request which breaks backward compatibility with should/type be accepted?

One more thing. I really like using Should. It has drastically reduced the complexity of our tests while making them much more readable. Should is a fantastic project.

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.