shouldjs / format Goto Github PK
View Code? Open in Web Editor NEWModule for text inspections for instances
License: MIT License
Module for text inspections for instances
License: MIT License
Need to check/fix RE
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.