add CommonJS assert module

RESOLVED WONTFIX

Status

Testing Graveyard
Mozmill
RESOLVED WONTFIX
7 years ago
a year ago

People

(Reporter: harth, Unassigned)

Tracking

Details

(Whiteboard: [mozmill-2.0+])

(Reporter)

Description

7 years ago
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.
(Reporter)

Comment 2

7 years ago
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"]
(Reporter)

Updated

7 years ago
Whiteboard: [mozmill-2.0?]

Comment 3

7 years ago
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.
(Reporter)

Comment 5

7 years ago
doing a CommonJS-based, but customized assert module in bug 637880
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → WONTFIX
Stumbled on this bug - FTR, the CommonJS assert module did land in bug 873126.
(Assignee)

Updated

a year ago
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.