GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Log in
  • Request account
  • Page
  • CommonJS
  • Implementations
  • FAQ
  • Mailing List
  • IRC Via Mochabot
  • IRC Logs
  • CommonJS.org
  • Recent changes
  • Random page
  • What links here
  • Related changes

This view

  • Original page
  • New address

GeezerVison is showing wiki.commonjs.org — Unit Testing - CommonJS Spec Wiki

Unit Testing

From CommonJS Spec Wiki
Jump to: navigation, search

STATUS: 1.0 RATIFIED, AMENDMENT PROPOSALS PENDING

Unit testing

Automated tests are an important part of software development today. Providing a standard test library will help encourage more people to write more tests. Additionally, the API specification will likely be written in the form of tests, so this component will be needed by the CommonJS project itself.

Testing involves both an API for easily defining tests and running assertions, plus a tool (or tools) for locating and running the tests.

Specifications and Proposals

  • 1.0 ratified

Known spec bugs in version 1.0:

  • Not self-consistent:
    assert.equal(4,new Number(4));
    assert.deepEqual(4, new Number(4));
  • Not self-consistent:
    assert.equal(/a/, /a/g);
    assert.deepEqual(/a/, /a/g);
  • 7.4 talks about checking prototype properties, not the internal [[Prototype]] itself (__proto__ or Object.getPrototypeOf)
  • Does not handle string equivalence, specifically that strings in deep equivalence calls must be identical, not equal after coercion.
  • assert.throws has to be written assert['throws'] in some implementations to get around protected keywords or JSLint
  • There's a call for "assert.equal" to either be strict or "fixed" for some value of correctness for equality comparison. [1]
  • The NodeJS mailing list calls for "assert.ifError", "assert.noError", or "assert.notOk" [2]

Prior Art

  • JsUnit - browser, native, Ant, and Maven based test runners
  • rhinounit - Ant based test runner
  • JavaScript Assertion Unit -
  • QUnit jQuery's unit testing framework, browser based
  • DOH JavaScript unit testing framework (used by Dojo, but without Dojo dependencies), supports browsers and stand-alone JavaScript environments.
  • JSSpec is a Javascript BDD(Behavior Driven Development) framework. http://code.google.com/p/jsspec/
  • JSpec is a minimalistic JavaScript behavior driven development framework http://github.com/visionmedia/jspec/tree/master
  • Better Javascript testing through ScrewUnit http://pivotallabs.com/users/nick/bl...ough-screwunit
  • Mochitest is an automated testing framework built on top of the MochiKit JavaScript libraries https://developer.mozilla.org/en/Mochitest
  • Yahoo! UI Library: YUI Test http://developer.yahoo.com/yui/yuitest/
  • JSMock is a fully featured Mock Object library for JavaScript that provides the necessary tools to do effective interactive based testing. http://jsmock.sourceforge.net/
  • JSLitmus is a lightweight tool for creating ad-hoc JavaScript benchmark tests. http://www.broofa.com/Tools/JSLitmus/
  • Jack is a toolkit for mocking JavaScript objects and functions. http://boss.bekk.no/display/BOSS/Jack
  • MockMe for JavaScript http://johanneslink.net/projects/mockme.html
  • qMock is a standalone, lightweight mocking framework that facilitates integration testing for JavaScript programs. http://code.google.com/p/qmock/
  • TDD JS with JsMock http://www.pathf.com/blogs/2006/11/tdd_and_javascr/
  • Test Driven Javascript http://www.testdrivenjavascript.com/Practice/5.aspx
  • jsUnity is a lightweight JavaScript testing framework that is context-agnostic http://jsunity.com/
  • JsUnitTest is based off unittest.js from prototypejs, except this library has no dependencies http://jsunittest.com
  • Inspec BDD style test framework http://github.com/aq1018/inspec
Retrieved from "https://wiki.commonjs.org/index.php?title=Unit_Testing&oldid=3105"
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.