Git Product home page Git Product logo

extended-javascript-console's People

Contributors

bignimbus avatar claire avatar tanzeelkazi 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

extended-javascript-console's Issues

Need messages for console.expect

console.expect methods only return booleans. These messages should be made more meaningful, descriptive, and (dare I say) pretty-looking.

Buggy object diff performance

As it stands, there are some issues with how the object diffs are handled. Instead of cloning the original object, the diff should be constructed only when the data differs from the original object.

Do not use CDN in browser extensions

Crossrider, the API used to make the xcon browser extension, is making a fresh XHR request on pageload. This can cause the extension to break on certain pages (#43) and degrade the UX. All future releases should hardcode the minified source code.

TDD in the console

Proposing a new method that is similar to the non-standard console.assert().

The idea is to use syntax that resembles testing frameworks for quick, accurate testing using the console. The console output would be equally descriptive as .run() so that we're not just doing some fancy syntax that boils down to a vanilla true/false log statement.

var objOne = {
  "something": "something"
},
objTwo = {
  "something": "something else"
};
console.compare(obj1).expect({"something": "something"}); 
// PASSED: expected obj1 to equal {something: something}
console.compare(obj1, obj2).expect(true); // compares two blobs, returns true if they are identical
// FAILED: expected obj1 to equal obj2
// diff: (show the diff)
console.compare(obj1, obj2); // outputs a diff
// obj2 differs from obj1: (show the diff)

/* or */

console.expect(obj1.something).toEqual("something"); // true
// ape Jasmine or Mocha syntax

Some thoughts from experienced test-writers would be helpful.

Unit tests for new modules

There are new modules that do not have tests yet. We should fix this and update any legacy tests that are no longer useful.

Testing complex/circular data structures

Right now, xcon gracefully errors out when calling .diff or .isEqual on complex data models (call stack size issues, usually). Alternative ways to test these structures would be nice to have.

Split condition module?

The condition module serves two different purposes currently: determining the type of the input and converting the input to a string depending on its type. We should consider splitting these two features into separate modules.

Make better use of AMD

We should look at all of the xcon methods and see how they can be migrated into more testable modules.

Truncate long messages

When a message exceeds a certain number of characters, xcon should truncate the message and call console.log() on the output instead.

For example, if there were a deeply nested object that has lots of data, JSON.stringify() would produce an prohibitively long error message when calling .diff or .expect . Instead of showing the entire string, it would make sense to truncate the message and call .log() to show the object/array in a more legible format.

newbie

hi, i just installed this to chrome on my chromebook as an extenion from the chromestore, but when i try console.out('joe'); it says console.out is undefined. thanks

Git hook

To encourage best practices, it would be nice to implement a githook that runs grunt jasmine as well as eslint rules. We should research and apply these in a way that makes sense for this project.

Tighten up developer tools

Currently the dev environment is not standardized. This ticket will be closed when a developer can pull a branch and get:

  • a test spec runner (phantomJS? jasmine in the browser?)
  • a package.json that only installs the stuff they need, configured properly

Console.run() should return non-function input

This feature is already partially implemented. Update source, docs, and specs to ensure that console.run(obj) or console.run(string) etc... returns the actual value. This allows for logging without taking up multiple lines:

var a = console.run('a');
a === 'a'; // true

AMD structure

Current source code should be ported to AMD modules.

A tool such as almond.js or amdclean should be used to concatenate and port modules into a single file that can be run in a browser without a module loader.

Comma-separated console.out parameters

Devs should be able to pass in an arbitrary amount of data into console.out a la console.log. opts will always be the last arg.

right now:

console.out('hello ', obj, opts); // will not function.  This should function.

expand suite of .expect testing methods

There are currently four methods possible in console.expect. There are additional methods that could be useful to developers. Those methods should be identified and developed.

Object diffs in console.expect

Diffs could be very useful for finding differences in complex data sets.

var harry = {"mock": "yeah", "yeah": "yeah"},
lloyd = {"bird": "yeah", "yeah": "yeah"};
console.expect(harry).toEqual(lloyd);

This should return something like:

FAILED: expect object harry to equal object lloyd
object harry has unique data
  {"mock": "yeah"}
object lloyd has unique data
  {"bird": "yeah"}

This will prove to be a complex task. Care must be taken to build exact paths to the diff data so that it is useful to the developer.

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.