Giter VIP home page Giter VIP logo

Comments (3)

jasondavies avatar jasondavies commented on April 20, 2024

Have you come across TestSwarm? (testswarm.com appears to be down, but you can read about it at https://github.com/jeresig/testswarm/wiki). Their opinion on headless testing:

A popular alternative to the process of launching browsers and running test suites is that of running tests in headless instances of browsers (or in browser simulations, like in Rhino). All of these suffer from a critical problem: At a fundamental level you are no longer running tests in an actual browser – and the results can no longer be guaranteed to be identical to an actual browser. Unfortunately nothing can truly replace the experience of running actual code in a real browser.

Now, TestSwarm does seem a bit Alpha (especially since the main site doesn't seem to be loading!) but it could be good if universal browser support is a priority (maybe it's not?)

The other thing to mention is the QUnit unit testing framework, which is quite nice. It's used by underscore.js - see the test/ directory. I set up some tests of my own using theirs as a starting point and it seemed very straightforward.

from d3.

mbostock avatar mbostock commented on April 20, 2024

My main requirement is minimal overhead during the development cycle; I should be able to run the unit tests quickly on the command line as part of the make process, so that I can run them continuously as I'm developing. The tests must be fast.

It seems reasonable to also have more comprehensive, distributed, asynchronous tests, outside the development cycle. With these you are notified later when tests fail. I put TestSwarm in that category. It'd be nice to have, but I'd prefer it in addition to the simpler headless tests.

jQuery is heavily focused on providing compatibility across browsers. D3 is not a compatibility layer. Yes, I'd like it to have universal browser support, but having tests for a single environment (such as Node/V8) would give us at least 90% of the value from testing. I'd rather have D3 focus on using the W3C standard APIs, a forward-looking approach, then get burdened with all this cross-browser nonsense. The main goal here is to support rich, interactive visualization in SVG and that's going to require a fast, modern browser regardless!

from d3.

mbostock avatar mbostock commented on April 20, 2024

Implemented a simple testing framework using Node & env-js. I'm tempted to look at Zombie.js, though, since I had to excise large chunks of env-js to get it to play nice. Good news is that the tests have already uncovered a few small bugs in d3.format and Sizzle integration. :) Hooray!

from d3.

Related Issues (20)

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.