Closed Bug 597578 Opened 14 years ago Closed 13 years ago

add CommonJS assert module

Categories

(Testing Graveyard :: Mozmill, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: harth, Unassigned)

Details

(Whiteboard: [mozmill-2.0+])

We should add the standard CommonJS assert module to Mozmill, putting it in the scope so test authors can import with:

var assert = require("assert");

assert.ok(true, "this should be true");

The specification lives here http://wiki.commonjs.org/wiki/Unit_Testing/1.0#Assert

The most up-to date implementation lives in node.js http://github.com/ry/node/blob/master/lib/assert.js, we will probably steal from one of the current implementations
Those will replace the JUM module's functions or our controller assert functions? I assume the first ones.
Yeah, it could replace the JUM module. The assert module contains less assert variations than the JUM module, but is pretty flexible:

JUM.assertUndefined(property) == assert.strictEqual(property, undefined)
JUM.assertNotNull(property) == assert.notStrictEqual(property, null)

JUM:
["assert", "assertTrue", "assertFalse", "assertEquals", "assertNotEquals",
 "assertNull", "assertNotNull", "assertUndefined", "assertNotUndefined",
 "assertNaN", "assertNotNaN", "fail", "pass"]
 
CommonJS assert:
["ok", "equal", "notEqual", "deepEqual", "notDeepEqual", "strictEqual", "notStrictEqual", "throws"]
Whiteboard: [mozmill-2.0?]
I believe Heather's already working on this.
Whiteboard: [mozmill-2.0?] → [mozmill-2.0+]
I'm also working on a solution for our shared modules right now. Lets sit together for a better planning. My current work happens on bug 634225.
doing a CommonJS-based, but customized assert module in bug 637880
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
Stumbled on this bug - FTR, the CommonJS assert module did land in bug 873126.
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.