You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2012/09/12 00:59:40 UTC
[9/14] updated package.json
http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/1d113e44/node_modules/nodeunit/dist/nodeunit/deps/ejs.js
----------------------------------------------------------------------
diff --git a/node_modules/nodeunit/dist/nodeunit/deps/ejs.js b/node_modules/nodeunit/dist/nodeunit/deps/ejs.js
deleted file mode 100644
index f6abf29..0000000
--- a/node_modules/nodeunit/dist/nodeunit/deps/ejs.js
+++ /dev/null
@@ -1,125 +0,0 @@
-
-/*!
- * EJS
- * Copyright(c) 2010 TJ Holowaychuk <tj...@vision-media.ca>
- * MIT Licensed
- */
-
-/**
- * Module dependencies.
- */
-
-var sys = require('sys');
-
-/**
- * Library version.
- */
-
-exports.version = '0.0.3';
-
-/**
- * Intermediate js cache.
- *
- * @type Object
- */
-
-var cache = {};
-
-/**
- * Clear intermediate js cache.
- *
- * @api public
- */
-
-exports.clearCache = function(){
- cache = {};
-};
-
-/**
- * Escape the given string of `html`.
- *
- * @param {String} html
- * @return {String}
- * @api private
- */
-
-function escape(html){
- return String(html)
- .replace(/&(?!\w+;)/g, '&')
- .replace(/</g, '<')
- .replace(/>/g, '>')
- .replace(/"/g, '"');
-}
-
-/**
- * Parse the given `str` of ejs, returning the function body.
- *
- * @param {String} str
- * @return {String}
- * @api public
- */
-
-var parse = exports.parse = function(str){
- return 'var buf = [];\n'
- + "with (locals) {\nbuf.push('"
- + String(str)
- .replace(/[\r\t]/g, " ")
- .replace(/\n/g, "\\n")
- .split("<%").join("\t")
- .replace(/((^|%>)[^\t]*)'/g, "$1\r")
- .replace(/\t=(.*?)%>/g, "', escape($1) ,'")
- .replace(/\t-(.*?)%>/g, "', $1 ,'")
- .split("\t").join("');")
- .split("%>").join("buf.push('")
- .split("\r").join("\\'")
- + "');\n}\nreturn buf.join('');";
-};
-
-/**
- * Compile the given `str` of ejs into a `Function`.
- *
- * @param {String} str
- * @param {Object} options
- * @return {Function}
- * @api public
- */
-
-var compile = exports.compile = function(str, options){
- if (options.debug) sys.puts(parse(str));
- return new Function('locals, escape', parse(str));
-};
-
-/**
- * Render the given `str` of ejs.
- *
- * Options:
- *
- * - `locals` Local variables object
- * - `cache` Compiled functions are cached, requires `filename`
- * - `filename` Used by `cache` to key caches
- * - `context|scope` Function execution context
- * - `debug` Output generated function body
- *
- * @param {String} str
- * @param {Object} options
- * @return {String}
- * @api public
- */
-
-exports.render = function(str, options){
- var fn,
- options = options || {};
- if (options.cache) {
- if (options.filename) {
- fn = cache[options.filename] = compile(str, options);
- } else {
- throw new Error('"cache" option requires "filename".');
- }
- } else {
- fn = compile(str, options);
- }
- return fn.call(
- options.context || options.scope,
- options.locals || {},
- escape);
-};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/1d113e44/node_modules/nodeunit/dist/nodeunit/deps/json2.js
----------------------------------------------------------------------
diff --git a/node_modules/nodeunit/dist/nodeunit/deps/json2.js b/node_modules/nodeunit/dist/nodeunit/deps/json2.js
deleted file mode 100644
index 1620595..0000000
--- a/node_modules/nodeunit/dist/nodeunit/deps/json2.js
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- http://www.JSON.org/json2.js
- 2010-11-17
-
- Public Domain.
-
- NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
-
- See http://www.JSON.org/js.html
-
-
- This code should be minified before deployment.
- See http://javascript.crockford.com/jsmin.html
-
- USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
- NOT CONTROL.
-
-
- This file creates a global JSON object containing two methods: stringify
- and parse.
-
- JSON.stringify(value, replacer, space)
- value any JavaScript value, usually an object or array.
-
- replacer an optional parameter that determines how object
- values are stringified for objects. It can be a
- function or an array of strings.
-
- space an optional parameter that specifies the indentation
- of nested structures. If it is omitted, the text will
- be packed without extra whitespace. If it is a number,
- it will specify the number of spaces to indent at each
- level. If it is a string (such as '\t' or ' '),
- it contains the characters used to indent at each level.
-
- This method produces a JSON text from a JavaScript value.
-
- When an object value is found, if the object contains a toJSON
- method, its toJSON method will be called and the result will be
- stringified. A toJSON method does not serialize: it returns the
- value represented by the name/value pair that should be serialized,
- or undefined if nothing should be serialized. The toJSON method
- will be passed the key associated with the value, and this will be
- bound to the value
-
- For example, this would serialize Dates as ISO strings.
-
- Date.prototype.toJSON = function (key) {
- function f(n) {
- // Format integers to have at least two digits.
- return n < 10 ? '0' + n : n;
- }
-
- return this.getUTCFullYear() + '-' +
- f(this.getUTCMonth() + 1) + '-' +
- f(this.getUTCDate()) + 'T' +
- f(this.getUTCHours()) + ':' +
- f(this.getUTCMinutes()) + ':' +
- f(this.getUTCSeconds()) + 'Z';
- };
-
- You can provide an optional replacer method. It will be passed the
- key and value of each member, with this bound to the containing
- object. The value that is returned from your method will be
- serialized. If your method returns undefined, then the member will
- be excluded from the serialization.
-
- If the replacer parameter is an array of strings, then it will be
- used to select the members to be serialized. It filters the results
- such that only members with keys listed in the replacer array are
- stringified.
-
- Values that do not have JSON representations, such as undefined or
- functions, will not be serialized. Such values in objects will be
- dropped; in arrays they will be replaced with null. You can use
- a replacer function to replace those with JSON values.
- JSON.stringify(undefined) returns undefined.
-
- The optional space parameter produces a stringification of the
- value that is filled with line breaks and indentation to make it
- easier to read.
-
- If the space parameter is a non-empty string, then that string will
- be used for indentation. If the space parameter is a number, then
- the indentation will be that many spaces.
-
- Example:
-
- text = JSON.stringify(['e', {pluribus: 'unum'}]);
- // text is '["e",{"pluribus":"unum"}]'
-
-
- text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
- // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
-
- text = JSON.stringify([new Date()], function (key, value) {
- return this[key] instanceof Date ?
- 'Date(' + this[key] + ')' : value;
- });
- // text is '["Date(---current time---)"]'
-
-
- JSON.parse(text, reviver)
- This method parses a JSON text to produce an object or array.
- It can throw a SyntaxError exception.
-
- The optional reviver parameter is a function that can filter and
- transform the results. It receives each of the keys and values,
- and its return value is used instead of the original value.
- If it returns what it received, then the structure is not modified.
- If it returns undefined then the member is deleted.
-
- Example:
-
- // Parse the text. Values that look like ISO date strings will
- // be converted to Date objects.
-
- myData = JSON.parse(text, function (key, value) {
- var a;
- if (typeof value === 'string') {
- a =
-/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
- if (a) {
- return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
- +a[5], +a[6]));
- }
- }
- return value;
- });
-
- myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
- var d;
- if (typeof value === 'string' &&
- value.slice(0, 5) === 'Date(' &&
- value.slice(-1) === ')') {
- d = new Date(value.slice(5, -1));
- if (d) {
- return d;
- }
- }
- return value;
- });
-
-
- This is a reference implementation. You are free to copy, modify, or
- redistribute.
-*/
-
-/*jslint evil: true, strict: false, regexp: false */
-
-/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
- call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
- getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
- lastIndex, length, parse, prototype, push, replace, slice, stringify,
- test, toJSON, toString, valueOf
-*/
-
-
-// Create a JSON object only if one does not already exist. We create the
-// methods in a closure to avoid creating global variables.
-
-var JSON = {};
-
-(function () {
- "use strict";
-
- function f(n) {
- // Format integers to have at least two digits.
- return n < 10 ? '0' + n : n;
- }
-
- if (typeof Date.prototype.toJSON !== 'function') {
-
- Date.prototype.toJSON = function (key) {
-
- return isFinite(this.valueOf()) ?
- this.getUTCFullYear() + '-' +
- f(this.getUTCMonth() + 1) + '-' +
- f(this.getUTCDate()) + 'T' +
- f(this.getUTCHours()) + ':' +
- f(this.getUTCMinutes()) + ':' +
- f(this.getUTCSeconds()) + 'Z' : null;
- };
-
- String.prototype.toJSON =
- Number.prototype.toJSON =
- Boolean.prototype.toJSON = function (key) {
- return this.valueOf();
- };
- }
-
- var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- gap,
- indent,
- meta = { // table of character substitutions
- '\b': '\\b',
- '\t': '\\t',
- '\n': '\\n',
- '\f': '\\f',
- '\r': '\\r',
- '"' : '\\"',
- '\\': '\\\\'
- },
- rep;
-
-
- function quote(string) {
-
-// If the string contains no control characters, no quote characters, and no
-// backslash characters, then we can safely slap some quotes around it.
-// Otherwise we must also replace the offending characters with safe escape
-// sequences.
-
- escapable.lastIndex = 0;
- return escapable.test(string) ?
- '"' + string.replace(escapable, function (a) {
- var c = meta[a];
- return typeof c === 'string' ? c :
- '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
- }) + '"' :
- '"' + string + '"';
- }
-
-
- function str(key, holder) {
-
-// Produce a string from holder[key].
-
- var i, // The loop counter.
- k, // The member key.
- v, // The member value.
- length,
- mind = gap,
- partial,
- value = holder[key];
-
-// If the value has a toJSON method, call it to obtain a replacement value.
-
- if (value && typeof value === 'object' &&
- typeof value.toJSON === 'function') {
- value = value.toJSON(key);
- }
-
-// If we were called with a replacer function, then call the replacer to
-// obtain a replacement value.
-
- if (typeof rep === 'function') {
- value = rep.call(holder, key, value);
- }
-
-// What happens next depends on the value's type.
-
- switch (typeof value) {
- case 'string':
- return quote(value);
-
- case 'number':
-
-// JSON numbers must be finite. Encode non-finite numbers as null.
-
- return isFinite(value) ? String(value) : 'null';
-
- case 'boolean':
- case 'null':
-
-// If the value is a boolean or null, convert it to a string. Note:
-// typeof null does not produce 'null'. The case is included here in
-// the remote chance that this gets fixed someday.
-
- return String(value);
-
-// If the type is 'object', we might be dealing with an object or an array or
-// null.
-
- case 'object':
-
-// Due to a specification blunder in ECMAScript, typeof null is 'object',
-// so watch out for that case.
-
- if (!value) {
- return 'null';
- }
-
-// Make an array to hold the partial results of stringifying this object value.
-
- gap += indent;
- partial = [];
-
-// Is the value an array?
-
- if (Object.prototype.toString.apply(value) === '[object Array]') {
-
-// The value is an array. Stringify every element. Use null as a placeholder
-// for non-JSON values.
-
- length = value.length;
- for (i = 0; i < length; i += 1) {
- partial[i] = str(i, value) || 'null';
- }
-
-// Join all of the elements together, separated with commas, and wrap them in
-// brackets.
-
- v = partial.length === 0 ? '[]' :
- gap ? '[\n' + gap +
- partial.join(',\n' + gap) + '\n' +
- mind + ']' :
- '[' + partial.join(',') + ']';
- gap = mind;
- return v;
- }
-
-// If the replacer is an array, use it to select the members to be stringified.
-
- if (rep && typeof rep === 'object') {
- length = rep.length;
- for (i = 0; i < length; i += 1) {
- k = rep[i];
- if (typeof k === 'string') {
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ': ' : ':') + v);
- }
- }
- }
- } else {
-
-// Otherwise, iterate through all of the keys in the object.
-
- for (k in value) {
- if (Object.hasOwnProperty.call(value, k)) {
- v = str(k, value);
- if (v) {
- partial.push(quote(k) + (gap ? ': ' : ':') + v);
- }
- }
- }
- }
-
-// Join all of the member texts together, separated with commas,
-// and wrap them in braces.
-
- v = partial.length === 0 ? '{}' :
- gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
- mind + '}' : '{' + partial.join(',') + '}';
- gap = mind;
- return v;
- }
- }
-
-// If the JSON object does not yet have a stringify method, give it one.
-
- if (typeof JSON.stringify !== 'function') {
- JSON.stringify = function (value, replacer, space) {
-
-// The stringify method takes a value and an optional replacer, and an optional
-// space parameter, and returns a JSON text. The replacer can be a function
-// that can replace values, or an array of strings that will select the keys.
-// A default replacer method can be provided. Use of the space parameter can
-// produce text that is more easily readable.
-
- var i;
- gap = '';
- indent = '';
-
-// If the space parameter is a number, make an indent string containing that
-// many spaces.
-
- if (typeof space === 'number') {
- for (i = 0; i < space; i += 1) {
- indent += ' ';
- }
-
-// If the space parameter is a string, it will be used as the indent string.
-
- } else if (typeof space === 'string') {
- indent = space;
- }
-
-// If there is a replacer, it must be a function or an array.
-// Otherwise, throw an error.
-
- rep = replacer;
- if (replacer && typeof replacer !== 'function' &&
- (typeof replacer !== 'object' ||
- typeof replacer.length !== 'number')) {
- throw new Error('JSON.stringify');
- }
-
-// Make a fake root object containing our value under the key of ''.
-// Return the result of stringifying the value.
-
- return str('', {'': value});
- };
- }
-
-
-// If the JSON object does not yet have a parse method, give it one.
-
- if (typeof JSON.parse !== 'function') {
- JSON.parse = function (text, reviver) {
-
-// The parse method takes a text and an optional reviver function, and returns
-// a JavaScript value if the text is a valid JSON text.
-
- var j;
-
- function walk(holder, key) {
-
-// The walk method is used to recursively walk the resulting structure so
-// that modifications can be made.
-
- var k, v, value = holder[key];
- if (value && typeof value === 'object') {
- for (k in value) {
- if (Object.hasOwnProperty.call(value, k)) {
- v = walk(value, k);
- if (v !== undefined) {
- value[k] = v;
- } else {
- delete value[k];
- }
- }
- }
- }
- return reviver.call(holder, key, value);
- }
-
-
-// Parsing happens in four stages. In the first stage, we replace certain
-// Unicode characters with escape sequences. JavaScript handles many characters
-// incorrectly, either silently deleting them, or treating them as line endings.
-
- text = String(text);
- cx.lastIndex = 0;
- if (cx.test(text)) {
- text = text.replace(cx, function (a) {
- return '\\u' +
- ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
- });
- }
-
-// In the second stage, we run the text against regular expressions that look
-// for non-JSON patterns. We are especially concerned with '()' and 'new'
-// because they can cause invocation, and '=' because it can cause mutation.
-// But just to be safe, we want to reject all unexpected forms.
-
-// We split the second stage into 4 regexp operations in order to work around
-// crippling inefficiencies in IE's and Safari's regexp engines. First we
-// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
-// replace all simple value tokens with ']' characters. Third, we delete all
-// open brackets that follow a colon or comma or that begin the text. Finally,
-// we look to see that the remaining characters are only whitespace or ']' or
-// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
-
- if (/^[\],:{}\s]*$/
-.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
-.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
-.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
-
-// In the third stage we use the eval function to compile the text into a
-// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
-// in JavaScript: it can begin a block or an object literal. We wrap the text
-// in parens to eliminate the ambiguity.
-
- j = eval('(' + text + ')');
-
-// In the optional fourth stage, we recursively walk the new structure, passing
-// each name/value pair to a reviver function for possible transformation.
-
- return typeof reviver === 'function' ?
- walk({'': j}, '') : j;
- }
-
-// If the text is not JSON parseable, then a SyntaxError is thrown.
-
- throw new SyntaxError('JSON.parse');
- };
- }
-}());
http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/1d113e44/node_modules/nodeunit/dist/nodeunit/index.js
----------------------------------------------------------------------
diff --git a/node_modules/nodeunit/dist/nodeunit/index.js b/node_modules/nodeunit/dist/nodeunit/index.js
deleted file mode 100644
index 07867d0..0000000
--- a/node_modules/nodeunit/dist/nodeunit/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-// This file is just added for convenience so this repository can be
-// directly checked out into a project's deps folder
-module.exports = require('./lib/nodeunit');
http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/1d113e44/node_modules/nodeunit/dist/nodeunit/lib/.swp
----------------------------------------------------------------------
diff --git a/node_modules/nodeunit/dist/nodeunit/lib/.swp b/node_modules/nodeunit/dist/nodeunit/lib/.swp
deleted file mode 100644
index feaf4f9..0000000
Binary files a/node_modules/nodeunit/dist/nodeunit/lib/.swp and /dev/null differ
http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/1d113e44/node_modules/nodeunit/dist/nodeunit/lib/assert.js
----------------------------------------------------------------------
diff --git a/node_modules/nodeunit/dist/nodeunit/lib/assert.js b/node_modules/nodeunit/dist/nodeunit/lib/assert.js
deleted file mode 100644
index 6f5f07e..0000000
--- a/node_modules/nodeunit/dist/nodeunit/lib/assert.js
+++ /dev/null
@@ -1,327 +0,0 @@
-/**
- * This file is based on the node.js assert module, but with some small
- * changes for browser-compatibility
- * THIS FILE SHOULD BE BROWSER-COMPATIBLE JS!
- */
-
-
-/**
- * Added for browser compatibility
- */
-
-var _keys = function(obj){
- if(Object.keys) return Object.keys(obj);
- if (typeof obj != 'object' && typeof obj != 'function') {
- throw new TypeError('-');
- }
- var keys = [];
- for(var k in obj){
- if(obj.hasOwnProperty(k)) keys.push(k);
- }
- return keys;
-};
-
-
-
-// http://wiki.commonjs.org/wiki/Unit_Testing/1.0
-//
-// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
-//
-// Originally from narwhal.js (http://narwhaljs.org)
-// Copyright (c) 2009 Thomas Robinson <280north.com>
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the 'Software'), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
-// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
-var pSlice = Array.prototype.slice;
-
-// 1. The assert module provides functions that throw
-// AssertionError's when particular conditions are not met. The
-// assert module must conform to the following interface.
-
-var assert = exports;
-
-// 2. The AssertionError is defined in assert.
-// new assert.AssertionError({message: message, actual: actual, expected: expected})
-
-assert.AssertionError = function AssertionError (options) {
- this.name = "AssertionError";
- this.message = options.message;
- this.actual = options.actual;
- this.expected = options.expected;
- this.operator = options.operator;
- var stackStartFunction = options.stackStartFunction || fail;
-
- if (Error.captureStackTrace) {
- Error.captureStackTrace(this, stackStartFunction);
- }
-};
-// code from util.inherits in node
-assert.AssertionError.super_ = Error;
-
-
-// EDITED FOR BROWSER COMPATIBILITY: replaced Object.create call
-// TODO: test what effect this may have
-var ctor = function () { this.constructor = assert.AssertionError; };
-ctor.prototype = Error.prototype;
-assert.AssertionError.prototype = new ctor();
-
-
-assert.AssertionError.prototype.toString = function() {
- if (this.message) {
- return [this.name+":", this.message].join(' ');
- } else {
- return [ this.name+":"
- , JSON.stringify(this.expected )
- , this.operator
- , JSON.stringify(this.actual)
- ].join(" ");
- }
-};
-
-// assert.AssertionError instanceof Error
-
-assert.AssertionError.__proto__ = Error.prototype;
-
-// At present only the three keys mentioned above are used and
-// understood by the spec. Implementations or sub modules can pass
-// other keys to the AssertionError's constructor - they will be
-// ignored.
-
-// 3. All of the following functions must throw an AssertionError
-// when a corresponding condition is not met, with a message that
-// may be undefined if not provided. All assertion methods provide
-// both the actual and expected values to the assertion error for
-// display purposes.
-
-function fail(actual, expected, message, operator, stackStartFunction) {
- throw new assert.AssertionError({
- message: message,
- actual: actual,
- expected: expected,
- operator: operator,
- stackStartFunction: stackStartFunction
- });
-}
-
-// EXTENSION! allows for well behaved errors defined elsewhere.
-assert.fail = fail;
-
-// 4. Pure assertion tests whether a value is truthy, as determined
-// by !!guard.
-// assert.ok(guard, message_opt);
-// This statement is equivalent to assert.equal(true, guard,
-// message_opt);. To test strictly for the value true, use
-// assert.strictEqual(true, guard, message_opt);.
-
-assert.ok = function ok(value, message) {
- if (!!!value) fail(value, true, message, "==", assert.ok);
-};
-
-// 5. The equality assertion tests shallow, coercive equality with
-// ==.
-// assert.equal(actual, expected, message_opt);
-
-assert.equal = function equal(actual, expected, message) {
- if (actual != expected) fail(actual, expected, message, "==", assert.equal);
-};
-
-// 6. The non-equality assertion tests for whether two objects are not equal
-// with != assert.notEqual(actual, expected, message_opt);
-
-assert.notEqual = function notEqual(actual, expected, message) {
- if (actual == expected) {
- fail(actual, expected, message, "!=", assert.notEqual);
- }
-};
-
-// 7. The equivalence assertion tests a deep equality relation.
-// assert.deepEqual(actual, expected, message_opt);
-
-assert.deepEqual = function deepEqual(actual, expected, message) {
- if (!_deepEqual(actual, expected)) {
- fail(actual, expected, message, "deepEqual", assert.deepEqual);
- }
-};
-
-function _deepEqual(actual, expected) {
- // 7.1. All identical values are equivalent, as determined by ===.
- if (actual === expected) {
- return true;
- // 7.2. If the expected value is a Date object, the actual value is
- // equivalent if it is also a Date object that refers to the same time.
- } else if (actual instanceof Date && expected instanceof Date) {
- return actual.getTime() === expected.getTime();
-
- // 7.2.1 If the expcted value is a RegExp object, the actual value is
- // equivalent if it is also a RegExp object that refers to the same source and options
- } else if (actual instanceof RegExp && expected instanceof RegExp) {
- return actual.source === expected.source &&
- actual.global === expected.global &&
- actual.ignoreCase === expected.ignoreCase &&
- actual.multiline === expected.multiline;
-
- // 7.3. Other pairs that do not both pass typeof value == "object",
- // equivalence is determined by ==.
- } else if (typeof actual != 'object' && typeof expected != 'object') {
- return actual == expected;
-
- // 7.4. For all other Object pairs, including Array objects, equivalence is
- // determined by having the same number of owned properties (as verified
- // with Object.prototype.hasOwnProperty.call), the same set of keys
- // (although not necessarily the same order), equivalent values for every
- // corresponding key, and an identical "prototype" property. Note: this
- // accounts for both named and indexed properties on Arrays.
- } else {
- return objEquiv(actual, expected);
- }
-}
-
-function isUndefinedOrNull (value) {
- return value === null || value === undefined;
-}
-
-function isArguments (object) {
- return Object.prototype.toString.call(object) == '[object Arguments]';
-}
-
-function objEquiv (a, b) {
- if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
- return false;
- // an identical "prototype" property.
- if (a.prototype !== b.prototype) return false;
- //~~~I've managed to break Object.keys through screwy arguments passing.
- // Converting to array solves the problem.
- if (isArguments(a)) {
- if (!isArguments(b)) {
- return false;
- }
- a = pSlice.call(a);
- b = pSlice.call(b);
- return _deepEqual(a, b);
- }
- try{
- var ka = _keys(a),
- kb = _keys(b),
- key, i;
- } catch (e) {//happens when one is a string literal and the other isn't
- return false;
- }
- // having the same number of owned properties (keys incorporates hasOwnProperty)
- if (ka.length != kb.length)
- return false;
- //the same set of keys (although not necessarily the same order),
- ka.sort();
- kb.sort();
- //~~~cheap key test
- for (i = ka.length - 1; i >= 0; i--) {
- if (ka[i] != kb[i])
- return false;
- }
- //equivalent values for every corresponding key, and
- //~~~possibly expensive deep test
- for (i = ka.length - 1; i >= 0; i--) {
- key = ka[i];
- if (!_deepEqual(a[key], b[key] ))
- return false;
- }
- return true;
-}
-
-// 8. The non-equivalence assertion tests for any deep inequality.
-// assert.notDeepEqual(actual, expected, message_opt);
-
-assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
- if (_deepEqual(actual, expected)) {
- fail(actual, expected, message, "notDeepEqual", assert.notDeepEqual);
- }
-};
-
-// 9. The strict equality assertion tests strict equality, as determined by ===.
-// assert.strictEqual(actual, expected, message_opt);
-
-assert.strictEqual = function strictEqual(actual, expected, message) {
- if (actual !== expected) {
- fail(actual, expected, message, "===", assert.strictEqual);
- }
-};
-
-// 10. The strict non-equality assertion tests for strict inequality, as determined by !==.
-// assert.notStrictEqual(actual, expected, message_opt);
-
-assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
- if (actual === expected) {
- fail(actual, expected, message, "!==", assert.notStrictEqual);
- }
-};
-
-function _throws (shouldThrow, block, err, message) {
- var exception = null,
- threw = false,
- typematters = true;
-
- message = message || "";
-
- //handle optional arguments
- if (arguments.length == 3) {
- if (typeof(err) == "string") {
- message = err;
- typematters = false;
- }
- } else if (arguments.length == 2) {
- typematters = false;
- }
-
- try {
- block();
- } catch (e) {
- threw = true;
- exception = e;
- }
-
- if (shouldThrow && !threw) {
- fail( "Missing expected exception"
- + (err && err.name ? " ("+err.name+")." : '.')
- + (message ? " " + message : "")
- );
- }
- if (!shouldThrow && threw && typematters && exception instanceof err) {
- fail( "Got unwanted exception"
- + (err && err.name ? " ("+err.name+")." : '.')
- + (message ? " " + message : "")
- );
- }
- if ((shouldThrow && threw && typematters && !(exception instanceof err)) ||
- (!shouldThrow && threw)) {
- throw exception;
- }
-};
-
-// 11. Expected to throw an error:
-// assert.throws(block, Error_opt, message_opt);
-
-assert.throws = function(block, /*optional*/error, /*optional*/message) {
- _throws.apply(this, [true].concat(pSlice.call(arguments)));
-};
-
-// EXTENSION! This is annoying to write outside this module.
-assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
- _throws.apply(this, [false].concat(pSlice.call(arguments)));
-};
-
-assert.ifError = function (err) { if (err) {throw err;}};
http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/1d113e44/node_modules/nodeunit/dist/nodeunit/lib/core.js
----------------------------------------------------------------------
diff --git a/node_modules/nodeunit/dist/nodeunit/lib/core.js b/node_modules/nodeunit/dist/nodeunit/lib/core.js
deleted file mode 100644
index 028745e..0000000
--- a/node_modules/nodeunit/dist/nodeunit/lib/core.js
+++ /dev/null
@@ -1,316 +0,0 @@
-/*!
- * Nodeunit
- * Copyright (c) 2010 Caolan McMahon
- * MIT Licensed
- *
- * THIS FILE SHOULD BE BROWSER-COMPATIBLE JS!
- * You can use @REMOVE_LINE_FOR_BROWSER to remove code from the browser build.
- * Only code on that line will be removed, it's mostly to avoid requiring code
- * that is node specific
- */
-
-/**
- * Module dependencies
- */
-
-var async = require('../deps/async'), //@REMOVE_LINE_FOR_BROWSER
- nodeunit = require('./nodeunit'), //@REMOVE_LINE_FOR_BROWSER
- types = require('./types'); //@REMOVE_LINE_FOR_BROWSER
-
-
-/**
- * Added for browser compatibility
- */
-
-var _keys = function (obj) {
- if (Object.keys) {
- return Object.keys(obj);
- }
- var keys = [];
- for (var k in obj) {
- if (obj.hasOwnProperty(k)) {
- keys.push(k);
- }
- }
- return keys;
-};
-
-
-var _copy = function (obj) {
- var nobj = {};
- var keys = _keys(obj);
- for (var i = 0; i < keys.length; i += 1) {
- nobj[keys[i]] = obj[keys[i]];
- }
- return nobj;
-};
-
-
-/**
- * Runs a test function (fn) from a loaded module. After the test function
- * calls test.done(), the callback is executed with an assertionList as its
- * second argument.
- *
- * @param {String} name
- * @param {Function} fn
- * @param {Object} opt
- * @param {Function} callback
- * @api public
- */
-
-exports.runTest = function (name, fn, opt, callback) {
- var options = types.options(opt);
-
- options.testStart(name);
- var start = new Date().getTime();
- var test = types.test(name, start, options, callback);
-
- try {
- fn(test);
- }
- catch (e) {
- test.done(e);
- }
-};
-
-/**
- * Takes an object containing test functions or other test suites as properties
- * and runs each in series. After all tests have completed, the callback is
- * called with a list of all assertions as the second argument.
- *
- * If a name is passed to this function it is prepended to all test and suite
- * names that run within it.
- *
- * @param {String} name
- * @param {Object} suite
- * @param {Object} opt
- * @param {Function} callback
- * @api public
- */
-
-exports.runSuite = function (name, suite, opt, callback) {
- suite = wrapGroup(suite);
- var keys = _keys(suite);
-
- async.concatSeries(keys, function (k, cb) {
- var prop = suite[k], _name;
-
- _name = name ? [].concat(name, k) : [k];
- _name.toString = function () {
- // fallback for old one
- return this.join(' - ');
- };
-
- if (typeof prop === 'function') {
- var in_name = false;
- for (var i = 0; i < _name.length; i += 1) {
- if (_name[i] === opt.testspec) {
- in_name = true;
- }
- }
- if (!opt.testspec || in_name) {
- if (opt.moduleStart) {
- opt.moduleStart();
- }
- exports.runTest(_name, suite[k], opt, cb);
- }
- else {
- return cb();
- }
- }
- else {
- exports.runSuite(_name, suite[k], opt, cb);
- }
- }, callback);
-};
-
-/**
- * Run each exported test function or test suite from a loaded module.
- *
- * @param {String} name
- * @param {Object} mod
- * @param {Object} opt
- * @param {Function} callback
- * @api public
- */
-
-exports.runModule = function (name, mod, opt, callback) {
- var options = _copy(types.options(opt));
-
- var _run = false;
- var _moduleStart = options.moduleStart;
-
- mod = wrapGroup(mod);
-
- function run_once() {
- if (!_run) {
- _run = true;
- _moduleStart(name);
- }
- }
- options.moduleStart = run_once;
-
- var start = new Date().getTime();
-
- exports.runSuite(null, mod, options, function (err, a_list) {
- var end = new Date().getTime();
- var assertion_list = types.assertionList(a_list, end - start);
- options.moduleDone(name, assertion_list);
- if (nodeunit.complete) {
- nodeunit.complete(name, assertion_list);
- }
- callback(null, a_list);
- });
-};
-
-/**
- * Treats an object literal as a list of modules keyed by name. Runs each
- * module and finished with calling 'done'. You can think of this as a browser
- * safe alternative to runFiles in the nodeunit module.
- *
- * @param {Object} modules
- * @param {Object} opt
- * @api public
- */
-
-// TODO: add proper unit tests for this function
-exports.runModules = function (modules, opt) {
- var all_assertions = [];
- var options = types.options(opt);
- var start = new Date().getTime();
-
- async.concatSeries(_keys(modules), function (k, cb) {
- exports.runModule(k, modules[k], options, cb);
- },
- function (err, all_assertions) {
- var end = new Date().getTime();
- options.done(types.assertionList(all_assertions, end - start));
- });
-};
-
-
-/**
- * Wraps a test function with setUp and tearDown functions.
- * Used by testCase.
- *
- * @param {Function} setUp
- * @param {Function} tearDown
- * @param {Function} fn
- * @api private
- */
-
-var wrapTest = function (setUp, tearDown, fn) {
- return function (test) {
- var context = {};
- if (tearDown) {
- var done = test.done;
- test.done = function (err) {
- try {
- tearDown.call(context, function (err2) {
- if (err && err2) {
- test._assertion_list.push(
- types.assertion({error: err})
- );
- return done(err2);
- }
- done(err || err2);
- });
- }
- catch (e) {
- done(e);
- }
- };
- }
- if (setUp) {
- setUp.call(context, function (err) {
- if (err) {
- return test.done(err);
- }
- fn.call(context, test);
- });
- }
- else {
- fn.call(context, test);
- }
- };
-};
-
-
-/**
- * Returns a serial callback from two functions.
- *
- * @param {Function} funcFirst
- * @param {Function} funcSecond
- * @api private
- */
-
-var getSerialCallback = function (fns) {
- if (!fns.length) {
- return null;
- }
- return function (callback) {
- var that = this;
- var bound_fns = [];
- for (var i = 0, len = fns.length; i < len; i++) {
- (function (j) {
- bound_fns.push(function () {
- return fns[j].apply(that, arguments);
- });
- })(i);
- }
- return async.series(bound_fns, callback);
- };
-};
-
-
-/**
- * Wraps a group of tests with setUp and tearDown functions.
- * Used by testCase.
- *
- * @param {Object} group
- * @param {Array} setUps - parent setUp functions
- * @param {Array} tearDowns - parent tearDown functions
- * @api private
- */
-
-var wrapGroup = function (group, setUps, tearDowns) {
- var tests = {};
-
- var setUps = setUps ? setUps.slice(): [];
- var tearDowns = tearDowns ? tearDowns.slice(): [];
-
- if (group.setUp) {
- setUps.push(group.setUp);
- delete group.setUp;
- }
- if (group.tearDown) {
- tearDowns.unshift(group.tearDown);
- delete group.tearDown;
- }
-
- var keys = _keys(group);
-
- for (var i = 0; i < keys.length; i += 1) {
- var k = keys[i];
- if (typeof group[k] === 'function') {
- tests[k] = wrapTest(
- getSerialCallback(setUps),
- getSerialCallback(tearDowns),
- group[k]
- );
- }
- else if (typeof group[k] === 'object') {
- tests[k] = wrapGroup(group[k], setUps, tearDowns);
- }
- }
- return tests;
-};
-
-
-/**
- * Backwards compatibility for test suites using old testCase API
- */
-
-exports.testCase = function (suite) {
- return suite;
-};
http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/1d113e44/node_modules/nodeunit/dist/nodeunit/lib/nodeunit.js
----------------------------------------------------------------------
diff --git a/node_modules/nodeunit/dist/nodeunit/lib/nodeunit.js b/node_modules/nodeunit/dist/nodeunit/lib/nodeunit.js
deleted file mode 100644
index e20e974..0000000
--- a/node_modules/nodeunit/dist/nodeunit/lib/nodeunit.js
+++ /dev/null
@@ -1,104 +0,0 @@
-/*!
- * Nodeunit
- * Copyright (c) 2010 Caolan McMahon
- * MIT Licensed
- */
-
-/**
- * Module dependencies
- */
-
-var async = require('../deps/async'),
- types = require('./types'),
- utils = require('./utils'),
- core = require('./core'),
- reporters = require('./reporters'),
- assert = require('./assert'),
- path = require('path')
- events = require('events');
-
-
-/**
- * Export sub-modules.
- */
-
-exports.types = types;
-exports.utils = utils;
-exports.reporters = reporters;
-exports.assert = assert;
-
-// backwards compatibility
-exports.testrunner = {
- run: function () {
- console.log(
- 'WARNING: nodeunit.testrunner is going to be deprecated, please ' +
- 'use nodeunit.reporters.default instead!'
- );
- return reporters['default'].run.apply(this, arguments);
- }
-};
-
-
-/**
- * Export all core functions
- */
-
-for (var k in core) {
- exports[k] = core[k];
-};
-
-
-/**
- * Load modules from paths array and run all exported tests in series. If a path
- * is a directory, load all supported file types inside it as modules. This only
- * reads 1 level deep in the directory and does not recurse through
- * sub-directories.
- *
- * @param {Array} paths
- * @param {Object} opt
- * @api public
- */
-
-exports.runFiles = function (paths, opt) {
- var all_assertions = [];
- var options = types.options(opt);
- var start = new Date().getTime();
-
- if (!paths.length) {
- return options.done(types.assertionList(all_assertions));
- }
-
- utils.modulePaths(paths, function (err, files) {
- if (err) throw err;
- async.concatSeries(files, function (file, cb) {
- var name = path.basename(file);
- exports.runModule(name, require(file), options, cb);
- },
- function (err, all_assertions) {
- var end = new Date().getTime();
- exports.done()
- options.done(types.assertionList(all_assertions, end - start));
- });
- });
-
-};
-
-/* Export all prototypes from events.EventEmitter */
-var label;
-for (label in events.EventEmitter.prototype) {
- exports[label] = events.EventEmitter.prototype[label];
-}
-
-/* Emit event 'complete' on completion of a test suite. */
-exports.complete = function(name, assertions)
-{
- exports.emit('complete', name, assertions);
-};
-
-/* Emit event 'complete' on completion of all tests. */
-exports.done = function()
-{
- exports.emit('done');
-};
-
-module.exports = exports;
http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/1d113e44/node_modules/nodeunit/dist/nodeunit/lib/reporters/browser.js
----------------------------------------------------------------------
diff --git a/node_modules/nodeunit/dist/nodeunit/lib/reporters/browser.js b/node_modules/nodeunit/dist/nodeunit/lib/reporters/browser.js
deleted file mode 100644
index 9836c90..0000000
--- a/node_modules/nodeunit/dist/nodeunit/lib/reporters/browser.js
+++ /dev/null
@@ -1,121 +0,0 @@
-/*!
- * Nodeunit
- * Copyright (c) 2010 Caolan McMahon
- * MIT Licensed
- *
- * THIS FILE SHOULD BE BROWSER-COMPATIBLE JS!
- * You can use @REMOVE_LINE_FOR_BROWSER to remove code from the browser build.
- * Only code on that line will be removed, its mostly to avoid requiring code
- * that is node specific
- */
-
-
-/**
- * NOTE: this test runner is not listed in index.js because it cannot be
- * used with the command-line tool, only inside the browser.
- */
-
-
-/**
- * Reporter info string
- */
-
-exports.info = "Browser-based test reporter";
-
-
-/**
- * Run all tests within each module, reporting the results
- *
- * @param {Array} files
- * @api public
- */
-
-exports.run = function (modules, options) {
- var start = new Date().getTime(), div;
- options = options || {};
- div = options.div || document.body;
-
- function setText(el, txt) {
- if ('innerText' in el) {
- el.innerText = txt;
- }
- else if ('textContent' in el){
- el.textContent = txt;
- }
- }
-
- function getOrCreate(tag, id) {
- var el = document.getElementById(id);
- if (!el) {
- el = document.createElement(tag);
- el.id = id;
- div.appendChild(el);
- }
- return el;
- };
-
- var header = getOrCreate('h1', 'nodeunit-header');
- var banner = getOrCreate('h2', 'nodeunit-banner');
- var userAgent = getOrCreate('h2', 'nodeunit-userAgent');
- var tests = getOrCreate('ol', 'nodeunit-tests');
- var result = getOrCreate('p', 'nodeunit-testresult');
-
- setText(userAgent, navigator.userAgent);
-
- nodeunit.runModules(modules, {
- moduleStart: function (name) {
- /*var mheading = document.createElement('h2');
- mheading.innerText = name;
- results.appendChild(mheading);
- module = document.createElement('ol');
- results.appendChild(module);*/
- },
- testDone: function (name, assertions) {
- var test = document.createElement('li');
- var strong = document.createElement('strong');
- strong.innerHTML = name + ' <b style="color: black;">(' +
- '<b class="fail">' + assertions.failures() + '</b>, ' +
- '<b class="pass">' + assertions.passes() + '</b>, ' +
- assertions.length +
- ')</b>';
- test.className = assertions.failures() ? 'fail': 'pass';
- test.appendChild(strong);
-
- var aList = document.createElement('ol');
- aList.style.display = 'none';
- test.onclick = function () {
- var d = aList.style.display;
- aList.style.display = (d == 'none') ? 'block': 'none';
- };
- for (var i=0; i<assertions.length; i++) {
- var li = document.createElement('li');
- var a = assertions[i];
- if (a.failed()) {
- li.innerHTML = (a.message || a.method || 'no message') +
- '<pre>' + (a.error.stack || a.error) + '</pre>';
- li.className = 'fail';
- }
- else {
- li.innerHTML = a.message || a.method || 'no message';
- li.className = 'pass';
- }
- aList.appendChild(li);
- }
- test.appendChild(aList);
- tests.appendChild(test);
- },
- done: function (assertions) {
- var end = new Date().getTime();
- var duration = end - start;
-
- var failures = assertions.failures();
- banner.className = failures ? 'fail': 'pass';
-
- result.innerHTML = 'Tests completed in ' + duration +
- ' milliseconds.<br/><span class="passed">' +
- assertions.passes() + '</span> assertions of ' +
- '<span class="all">' + assertions.length + '<span> passed, ' +
- assertions.failures() + ' failed.';
- }
- });
-};
http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/1d113e44/node_modules/nodeunit/dist/nodeunit/lib/reporters/default.js
----------------------------------------------------------------------
diff --git a/node_modules/nodeunit/dist/nodeunit/lib/reporters/default.js b/node_modules/nodeunit/dist/nodeunit/lib/reporters/default.js
deleted file mode 100644
index a72a42e..0000000
--- a/node_modules/nodeunit/dist/nodeunit/lib/reporters/default.js
+++ /dev/null
@@ -1,130 +0,0 @@
-/*!
- * Nodeunit
- * Copyright (c) 2010 Caolan McMahon
- * MIT Licensed
- */
-
-/**
- * Module dependencies
- */
-
-var nodeunit = require('../nodeunit'),
- utils = require('../utils'),
- fs = require('fs'),
- track = require('../track'),
- path = require('path'),
- AssertionError = require('../assert').AssertionError;
-
-/**
- * Reporter info string
- */
-
-exports.info = "Default tests reporter";
-
-
-/**
- * Run all tests within each module, reporting the results to the command-line.
- *
- * @param {Array} files
- * @api public
- */
-
-exports.run = function (files, options, callback) {
-
- if (!options) {
- // load default options
- var content = fs.readFileSync(
- __dirname + '/../../bin/nodeunit.json', 'utf8'
- );
- options = JSON.parse(content);
- }
-
- var error = function (str) {
- return options.error_prefix + str + options.error_suffix;
- };
- var ok = function (str) {
- return options.ok_prefix + str + options.ok_suffix;
- };
- var bold = function (str) {
- return options.bold_prefix + str + options.bold_suffix;
- };
- var assertion_message = function (str) {
- return options.assertion_prefix + str + options.assertion_suffix;
- };
-
- var start = new Date().getTime();
- var tracker = track.createTracker(function (tracker) {
- if (tracker.unfinished()) {
- console.log('');
- console.log(error(bold(
- 'FAILURES: Undone tests (or their setups/teardowns): '
- )));
- var names = tracker.names();
- for (var i = 0; i < names.length; i += 1) {
- console.log('- ' + names[i]);
- }
- console.log('');
- console.log('To fix this, make sure all tests call test.done()');
- process.reallyExit(tracker.unfinished());
- }
- });
-
- var opts = {
- testspec: options.testspec,
- moduleStart: function (name) {
- console.log('\n' + bold(name));
- },
- testDone: function (name, assertions) {
- tracker.remove(name);
-
- if (!assertions.failures()) {
- console.log('✔ ' + name);
- }
- else {
- console.log(error('✖ ' + name) + '\n');
- assertions.forEach(function (a) {
- if (a.failed()) {
- a = utils.betterErrors(a);
- if (a.error instanceof AssertionError && a.message) {
- console.log(
- 'Assertion Message: ' +
- assertion_message(a.message)
- );
- }
- console.log(a.error.stack + '\n');
- }
- });
- }
- },
- done: function (assertions, end) {
- var end = end || new Date().getTime();
- var duration = end - start;
- if (assertions.failures()) {
- console.log(
- '\n' + bold(error('FAILURES: ')) + assertions.failures() +
- '/' + assertions.length + ' assertions failed (' +
- assertions.duration + 'ms)'
- );
- }
- else {
- console.log(
- '\n' + bold(ok('OK: ')) + assertions.length +
- ' assertions (' + assertions.duration + 'ms)'
- );
- }
-
- if (callback) callback(assertions.failures() ? new Error('We have got test failures.') : undefined);
- },
- testStart: function(name) {
- tracker.put(name);
- }
- };
- if (files && files.length) {
- var paths = files.map(function (p) {
- return path.join(process.cwd(), p);
- });
- nodeunit.runFiles(paths, opts);
- } else {
- nodeunit.runModules(files,opts);
- }
-};
http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/1d113e44/node_modules/nodeunit/dist/nodeunit/lib/reporters/eclipse.js
----------------------------------------------------------------------
diff --git a/node_modules/nodeunit/dist/nodeunit/lib/reporters/eclipse.js b/node_modules/nodeunit/dist/nodeunit/lib/reporters/eclipse.js
deleted file mode 100644
index 6775ff1..0000000
--- a/node_modules/nodeunit/dist/nodeunit/lib/reporters/eclipse.js
+++ /dev/null
@@ -1,104 +0,0 @@
-/*!
- * Nodeunit
- * Copyright (c) 2010 Caolan McMahon
- * MIT Licensed
- */
-
-/**
- * Module dependencies
- */
-
-var nodeunit = require('../nodeunit'),
- utils = require('../utils'),
- fs = require('fs'),
- track = require('../track'),
- path = require('path'),
- AssertionError = require('../assert').AssertionError;
-
-/**
- * Reporter info string
- */
-
-exports.info = "Reporter for eclipse plugin";
-
-
-/**
- * Run all tests within each module, reporting the results to the command-line.
- *
- * @param {Array} files
- * @api public
- */
-
-exports.run = function (files, options, callback) {
-
- var start = new Date().getTime();
- var paths = files.map(function (p) {
- if (p.indexOf('/') === 0) {
- return p;
- }
- return path.join(process.cwd(), p);
- });
- var tracker = track.createTracker(function (tracker) {
- if (tracker.unfinished()) {
- console.log('');
- console.log('FAILURES: Undone tests (or their setups/teardowns): ');
- var names = tracker.names();
- for (var i = 0; i < names.length; i += 1) {
- console.log('- ' + names[i]);
- }
- console.log('');
- console.log('To fix this, make sure all tests call test.done()');
- process.reallyExit(tracker.unfinished());
- }
- });
-
- nodeunit.runFiles(paths, {
- testspec: undefined,
- moduleStart: function (name) {
- console.log('\n' + name);
- },
- testDone: function (name, assertions) {
- tracker.remove(name);
-
- if (!assertions.failures()) {
- console.log('✔ ' + name);
- }
- else {
- console.log('✖ ' + name + '\n');
- assertions.forEach(function (a) {
- if (a.failed()) {
- a = utils.betterErrors(a);
- if (a.error instanceof AssertionError && a.message) {
- console.log(
- 'Assertion Message: ' + a.message
- );
- }
- console.log(a.error.stack + '\n');
- }
- });
- }
- },
- done: function (assertions, end) {
- var end = end || new Date().getTime();
- var duration = end - start;
- if (assertions.failures()) {
- console.log(
- '\n' + 'FAILURES: ' + assertions.failures() +
- '/' + assertions.length + ' assertions failed (' +
- assertions.duration + 'ms)'
- );
- }
- else {
- console.log(
- '\n' + 'OK: ' + assertions.length +
- ' assertions (' + assertions.duration + 'ms)'
- );
- }
-
- if (callback) callback(assertions.failures() ? new Error('We have got test failures.') : undefined);
- },
- testStart: function (name) {
- tracker.put(name);
- }
- });
-};
http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/1d113e44/node_modules/nodeunit/dist/nodeunit/lib/reporters/html.js
----------------------------------------------------------------------
diff --git a/node_modules/nodeunit/dist/nodeunit/lib/reporters/html.js b/node_modules/nodeunit/dist/nodeunit/lib/reporters/html.js
deleted file mode 100644
index 2790b58..0000000
--- a/node_modules/nodeunit/dist/nodeunit/lib/reporters/html.js
+++ /dev/null
@@ -1,109 +0,0 @@
-/*!
- * Nodeunit
- * Copyright (c) 2010 Caolan McMahon
- * MIT Licensed
- */
-
-/**
- * Module dependencies
- */
-
-var nodeunit = require('../nodeunit'),
- utils = require('../utils'),
- fs = require('fs'),
- path = require('path'),
- AssertionError = require('assert').AssertionError;
-
-/**
- * Reporter info string
- */
-
-exports.info = "Report tests result as HTML";
-
-/**
- * Run all tests within each module, reporting the results to the command-line.
- *
- * @param {Array} files
- * @api public
- */
-
-exports.run = function (files, options, callback) {
-
- var start = new Date().getTime();
- var paths = files.map(function (p) {
- return path.join(process.cwd(), p);
- });
-
- console.log('<html>');
- console.log('<head>');
- console.log('<title></title>');
- console.log('<style type="text/css">');
- console.log('body { font: 12px Helvetica Neue }');
- console.log('h2 { margin:0 ; padding:0 }');
- console.log('pre { font: 11px Andale Mono; margin-left: 1em; padding-left: 1em; margin-top:0; font-size:smaller;}');
- console.log('.assertion_message { margin-left: 1em; }');
- console.log(' ol {' +
- ' list-style: none;' +
- ' margin-left: 1em;' +
- ' padding-left: 1em;' +
- ' text-indent: -1em;' +
- '}');
- console.log(' ol li.pass:before { content: "\\2714 \\0020"; }');
- console.log(' ol li.fail:before { content: "\\2716 \\0020"; }');
- console.log('</style>');
- console.log('</head>');
- console.log('<body>');
- nodeunit.runFiles(paths, {
- testspec: options.testspec,
- moduleStart: function (name) {
- console.log('<h2>' + name + '</h2>');
- console.log('<ol>');
- },
- testDone: function (name, assertions) {
- if (!assertions.failures()) {
- console.log('<li class="pass">' + name + '</li>');
- }
- else {
- console.log('<li class="fail">' + name);
- assertions.forEach(function (a) {
- if (a.failed()) {
- a = utils.betterErrors(a);
- if (a.error instanceof AssertionError && a.message) {
- console.log('<div class="assertion_message">' +
- 'Assertion Message: ' + a.message +
- '</div>');
- }
- console.log('<pre>');
- console.log(a.error.stack);
- console.log('</pre>');
- }
- });
- console.log('</li>');
- }
- },
- moduleDone: function () {
- console.log('</ol>');
- },
- done: function (assertions) {
- var end = new Date().getTime();
- var duration = end - start;
- if (assertions.failures()) {
- console.log(
- '<h3>FAILURES: ' + assertions.failures() +
- '/' + assertions.length + ' assertions failed (' +
- assertions.duration + 'ms)</h3>'
- );
- }
- else {
- console.log(
- '<h3>OK: ' + assertions.length +
- ' assertions (' + assertions.duration + 'ms)</h3>'
- );
- }
- console.log('</body>');
- console.log('</html>');
-
- if (callback) callback(assertions.failures() ? new Error('We have got test failures.') : undefined);
- }
- });
-};
http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/1d113e44/node_modules/nodeunit/dist/nodeunit/lib/reporters/index.js
----------------------------------------------------------------------
diff --git a/node_modules/nodeunit/dist/nodeunit/lib/reporters/index.js b/node_modules/nodeunit/dist/nodeunit/lib/reporters/index.js
deleted file mode 100644
index b3989c0..0000000
--- a/node_modules/nodeunit/dist/nodeunit/lib/reporters/index.js
+++ /dev/null
@@ -1,14 +0,0 @@
-module.exports = {
- 'junit': require('./junit'),
- 'default': require('./default'),
- 'skip_passed': require('./skip_passed'),
- 'minimal': require('./minimal'),
- 'html': require('./html'),
- 'eclipse': require('./eclipse'),
- 'machineout': require('./machineout'),
- 'tap': require('./tap'),
- 'nested': require('./nested'),
- 'verbose' : require('./verbose')
- // browser test reporter is not listed because it cannot be used
- // with the command line tool, only inside a browser.
-};
http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/1d113e44/node_modules/nodeunit/dist/nodeunit/lib/reporters/junit.js
----------------------------------------------------------------------
diff --git a/node_modules/nodeunit/dist/nodeunit/lib/reporters/junit.js b/node_modules/nodeunit/dist/nodeunit/lib/reporters/junit.js
deleted file mode 100644
index b49d5e6..0000000
--- a/node_modules/nodeunit/dist/nodeunit/lib/reporters/junit.js
+++ /dev/null
@@ -1,183 +0,0 @@
-/*!
- * Nodeunit
- * Copyright (c) 2010 Caolan McMahon
- * MIT Licensed
- */
-
-/**
- * Module dependencies
- */
-
-var nodeunit = require('../nodeunit'),
- utils = require('../utils'),
- fs = require('fs'),
- path = require('path'),
- async = require('../../deps/async'),
- AssertionError = require('assert').AssertionError,
- child_process = require('child_process'),
- ejs = require('../../deps/ejs');
-
-
-/**
- * Reporter info string
- */
-
-exports.info = "jUnit XML test reports";
-
-
-/**
- * Ensures a directory exists using mkdir -p.
- *
- * @param {String} path
- * @param {Function} callback
- * @api private
- */
-
-var ensureDir = function (path, callback) {
- var mkdir = child_process.spawn('mkdir', ['-p', path]);
- mkdir.on('error', function (err) {
- callback(err);
- callback = function(){};
- });
- mkdir.on('exit', function (code) {
- if (code === 0) callback();
- else callback(new Error('mkdir exited with code: ' + code));
- });
-};
-
-
-/**
- * Returns absolute version of a path. Relative paths are interpreted
- * relative to process.cwd() or the cwd parameter. Paths that are already
- * absolute are returned unaltered.
- *
- * @param {String} p
- * @param {String} cwd
- * @return {String}
- * @api public
- */
-
-var abspath = function (p, /*optional*/cwd) {
- if (p[0] === '/') return p;
- cwd = cwd || process.cwd();
- return path.normalize(path.join(cwd, p));
-};
-
-
-/**
- * Run all tests within each module, reporting the results to the command-line,
- * then writes out junit-compatible xml documents.
- *
- * @param {Array} files
- * @api public
- */
-
-exports.run = function (files, opts, callback) {
- if (!opts.output) {
- console.error(
- 'Error: No output directory defined.\n' +
- '\tEither add an "output" property to your nodeunit.json config ' +
- 'file, or\n\tuse the --output command line option.'
- );
- return;
- }
- opts.output = abspath(opts.output);
- var error = function (str) {
- return opts.error_prefix + str + opts.error_suffix;
- };
- var ok = function (str) {
- return opts.ok_prefix + str + opts.ok_suffix;
- };
- var bold = function (str) {
- return opts.bold_prefix + str + opts.bold_suffix;
- };
-
- var start = new Date().getTime();
- var paths = files.map(function (p) {
- return path.join(process.cwd(), p);
- });
-
- var modules = {}
- var curModule;
-
- nodeunit.runFiles(paths, {
- testspec: opts.testspec,
- moduleStart: function (name) {
- curModule = {
- errorCount: 0,
- failureCount: 0,
- tests: 0,
- testcases: [],
- name: name
- };
- modules[name] = curModule;
- },
- testDone: function (name, assertions) {
- var testcase = {name: name};
- for (var i=0; i<assertions.length; i++) {
- var a = assertions[i];
- if (a.failed()) {
- a = utils.betterErrors(a);
- testcase.failure = {
- message: a.message,
- backtrace: a.error.stack
- };
-
- if (a.error instanceof AssertionError) {
- curModule.failureCount++;
- }
- else {
- curModule.errorCount++;
- }
- break;
- }
- }
- curModule.tests++;
- curModule.testcases.push(testcase);
- },
- done: function (assertions) {
- var end = new Date().getTime();
- var duration = end - start;
-
- ensureDir(opts.output, function (err) {
- var tmpl = __dirname + "/../../share/junit.xml.ejs";
- fs.readFile(tmpl, function (err, data) {
- if (err) throw err;
- var tmpl = data.toString();
-
- async.forEach(Object.keys(modules), function (k, cb) {
- var module = modules[k];
- var rendered = ejs.render(tmpl, {
- locals: {suites: [module]}
- });
- var filename = path.join(
- opts.output,
- module.name + '.xml'
- );
- console.log('Writing ' + filename);
- fs.writeFile(filename, rendered, cb);
- },
- function (err) {
- if (err) throw err;
- else if (assertions.failures()) {
- console.log(
- '\n' + bold(error('FAILURES: ')) +
- assertions.failures() + '/' +
- assertions.length + ' assertions failed (' +
- assertions.duration + 'ms)'
- );
- }
- else {
- console.log(
- '\n' + bold(ok('OK: ')) + assertions.length +
- ' assertions (' + assertions.duration + 'ms)'
- );
- }
- });
-
- if (callback) callback(assertions.failures() ? new Error('We have got test failures.') : undefined);
- });
- });
- }
- });
-}
http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/1d113e44/node_modules/nodeunit/dist/nodeunit/lib/reporters/machineout.js
----------------------------------------------------------------------
diff --git a/node_modules/nodeunit/dist/nodeunit/lib/reporters/machineout.js b/node_modules/nodeunit/dist/nodeunit/lib/reporters/machineout.js
deleted file mode 100644
index 4916d4c..0000000
--- a/node_modules/nodeunit/dist/nodeunit/lib/reporters/machineout.js
+++ /dev/null
@@ -1,111 +0,0 @@
-/*!
- * Nodeunit
- *
- * @author Alisue (lambdalisue@hashnote.net)
- * @url http://hashnote.net/
- *
- * Copyright (c) 2011 Alisue
- * MIT Licensed
- */
-
-/**
- * Module dependencies
- */
-
-var nodeunit = require('../nodeunit'),
- utils = require('../utils'),
- fs = require('fs'),
- track = require('../track'),
- path = require('path'),
- AssertionError = require('../assert').AssertionError;
-
-/**
- * Reporter info string
- */
-
-exports.info = "Tests reporter for machinally analysis";
-
-
-/**
- * Run all tests within each module, reporting the results to the command-line.
- *
- * @param {Array} files
- * @api public
- */
-
-exports.run = function (files, options, callback) {
- // options doesn't effect
-
- var parseStack = function (stack, delimiter) {
- var parseTrace = function (trace) {
- var filename, row, column;
- pattern1 = /\s{4}at\s\S+\s\(([^:]+):(\d+):(\d+)\)/;
- pattern2 = /\s{4}at\s([^:]+):(\d+):(\d+)/;
-
- if (trace.match(pattern1) !== null) {
- filename = RegExp.$1;
- row = RegExp.$2;
- column = RegExp.$3;
- } else if (trace.match(pattern2) !== null) {
- filename = RegExp.$1;
- row = RegExp.$2;
- column = RegExp.$3;
- } else {
- throw new Error("Could not parse a line of stack trace: " + trace);
- }
- return {filename: filename, row: row, column: column};
- };
- if (delimiter === undefined) {
- delimiter = ':';
- }
- traceback = stack.split('\n');
- firstline = traceback.shift();
- trace = parseTrace(traceback[0]);
- return {filename: trace.filename, row: trace.row, column: trace.column, message: firstline};
- };
- var createErrorMessage = function(type, name, filename, row, column, message){
- return [type, name, filename, row, column, message].join(":");
- };
- var paths = files.map(function (p) {
- return path.join(process.cwd(), p);
- });
- var tracker = track.createTracker(function (tracker) {
- if (tracker.unfinished()) {
- var names = tracker.names();
- for (var i = 0; i < names.length; i += 1) {
- console.log(createErrorMessage(
- 'Error', names[i],
- '', '', '',
- 'Undone tests - To fix this, make sure all tests call test.done()'
- ));
- }
- process.reallyExit(tracker.unfinished());
- }
- });
-
- nodeunit.runFiles(paths, {
- testspec: options.testspec,
- moduleStart: function (name) {},
- testDone: function (name, assertions) {
- tracker.remove(name);
- if (assertions.failures()) {
- assertions.forEach(function (a) {
- var stacks, message, filename, row, column;
- if (a.failed()) {
- stackinfo = parseStack(a.error.stack, ':');
- console.log(createErrorMessage(
- 'Fail', name, stackinfo.filename,
- stackinfo.row, stackinfo.column, stackinfo.message));
- }
- });
- }
- },
- done: function (assertions, end) {
- if (callback) callback(assertions.failures() ? new Error('We have got test failures.') : undefined);
- },
- testStart: function(name) {
- tracker.put(name);
- }
- });
-};
-
http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/1d113e44/node_modules/nodeunit/dist/nodeunit/lib/reporters/minimal.js
----------------------------------------------------------------------
diff --git a/node_modules/nodeunit/dist/nodeunit/lib/reporters/minimal.js b/node_modules/nodeunit/dist/nodeunit/lib/reporters/minimal.js
deleted file mode 100644
index 8ea6bff..0000000
--- a/node_modules/nodeunit/dist/nodeunit/lib/reporters/minimal.js
+++ /dev/null
@@ -1,120 +0,0 @@
-/*!
- * Nodeunit
- * Copyright (c) 2010 Caolan McMahon
- * MIT Licensed
- */
-
-/**
- * Module dependencies
- */
-
-var nodeunit = require('../nodeunit'),
- utils = require('../utils'),
- fs = require('fs'),
- path = require('path'),
- AssertionError = require('assert').AssertionError;
-
-/**
- * Reporter info string
- */
-
-exports.info = "Pretty minimal output";
-
-/**
- * Run all tests within each module, reporting the results to the command-line.
- *
- * @param {Array} files
- * @api public
- */
-
-exports.run = function (files, options, callback) {
-
- if (!options) {
- // load default options
- var content = fs.readFileSync(
- __dirname + '/../../bin/nodeunit.json', 'utf8'
- );
- options = JSON.parse(content);
- }
-
- var red = function (str) {
- return options.error_prefix + str + options.error_suffix;
- };
- var green = function (str) {
- return options.ok_prefix + str + options.ok_suffix;
- };
- var magenta = function (str) {
- return options.assertion_prefix + str + options.assertion_suffix;
- };
- var bold = function (str) {
- return options.bold_prefix + str + options.bold_suffix;
- };
-
- var start = new Date().getTime();
-
- var opts = {
- testspec: options.testspec,
- moduleStart: function (name) {
- process.stdout.write(bold(name) + ': ');
- },
- moduleDone: function (name, assertions) {
- console.log('');
- if (assertions.failures()) {
- assertions.forEach(function (a) {
- if (a.failed()) {
- a = utils.betterErrors(a);
- if (a.error instanceof AssertionError && a.message) {
- console.log(
- 'Assertion in test ' + bold(a.testname) + ': ' +
- magenta(a.message)
- );
- }
- console.log(a.error.stack + '\n');
- }
- });
- }
-
- },
- testStart: function () {
- },
- testDone: function (name, assertions) {
- if (!assertions.failures()) {
- process.stdout.write('.');
- }
- else {
- process.stdout.write(red('F'));
- assertions.forEach(function (assertion) {
- assertion.testname = name;
- });
- }
- },
- done: function (assertions) {
- var end = new Date().getTime();
- var duration = end - start;
- if (assertions.failures()) {
- console.log(
- '\n' + bold(red('FAILURES: ')) + assertions.failures() +
- '/' + assertions.length + ' assertions failed (' +
- assertions.duration + 'ms)'
- );
- }
- else {
- console.log(
- '\n' + bold(green('OK: ')) + assertions.length +
- ' assertions (' + assertions.duration + 'ms)'
- );
- }
-
- if (callback) callback(assertions.failures() ? new Error('We have got test failures.') : undefined);
- }
- };
-
- if (files && files.length) {
- var paths = files.map(function (p) {
- return path.join(process.cwd(), p);
- });
- nodeunit.runFiles(paths, opts);
- } else {
- nodeunit.runModules(files,opts);
- }
-};
http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/1d113e44/node_modules/nodeunit/dist/nodeunit/lib/reporters/nested.js
----------------------------------------------------------------------
diff --git a/node_modules/nodeunit/dist/nodeunit/lib/reporters/nested.js b/node_modules/nodeunit/dist/nodeunit/lib/reporters/nested.js
deleted file mode 100644
index b2d4f94..0000000
--- a/node_modules/nodeunit/dist/nodeunit/lib/reporters/nested.js
+++ /dev/null
@@ -1,213 +0,0 @@
-/*!
- * Nodeunit
- * Copyright (c) 2010 Caolan McMahon
- * MIT Licensed
- */
-
-/**
- * Module dependencies
- */
-
-var nodeunit = require('../nodeunit'),
- utils = require('../utils'),
- fs = require('fs'),
- track = require('../track'),
- path = require('path'),
- AssertionError = require('../assert').AssertionError;
-
-/**
- * Reporter info string
- */
-
-exports.info = "Nested test reporter";
-
-
-/**
- * Run all tests within each module, reporting the results to the command-line.
- *
- * @param {Array} files
- * @api public
- */
-
-exports.run = function (files, options) {
-
- if (!options) {
- // load default options
- var content = fs.readFileSync(
- __dirname + '/../../bin/nodeunit.json',
- 'utf8'
- );
- options = JSON.parse(content);
- }
-
- var error = function (str) {
- return options.error_prefix + str + options.error_suffix;
- };
- var ok = function (str) {
- return options.ok_prefix + str + options.ok_suffix;
- };
- var bold = function (str) {
- return options.bold_prefix + str + options.bold_suffix;
- };
- var assertion_message = function (str) {
- return options.assertion_prefix + str + options.assertion_suffix;
- };
-
- var spaces_per_indent = options.spaces_per_indent || 4;
-
- var start = new Date().getTime();
- var paths = files.map(function (p) {
- return path.join(process.cwd(), p);
- });
- var tracker = track.createTracker(function (tracker) {
- var i, names;
- if (tracker.unfinished()) {
- console.log('');
- console.log(error(bold(
- 'FAILURES: Undone tests (or their setups/teardowns): '
- )));
- names = tracker.names();
- for (i = 0; i < names.length; i += 1) {
- console.log('- ' + names[i]);
- }
- console.log('');
- console.log('To fix this, make sure all tests call test.done()');
- process.reallyExit(tracker.unfinished());
- }
- });
-
- // Object to hold status of each 'part' of the testCase/name array,
- // i.e., whether this part has been printed yet.
- tracker.already_printed = {};
-
- var pass_text = function (txt) {
- // Print in bold green.
- return bold(ok(txt + " (pass)"));
- };
-
- var fail_text = function (txt) {
- return bold(error(txt + " (fail) ✖ "));
- };
-
- var status_text = function (txt, status) {
- if (status === 'pass') {
- return pass_text(txt);
- } else {
- return fail_text(txt);
- }
- };
-
- /**
- * Slices an array, returns a string by joining the sliced elements.
- * @example
- * > name_slice(['TC1', 'TC1.1', 'mytest'], 1);
- * "TC1,TC1.1"
- */
- var name_slice = function (name_arr, end_index) {
- return name_arr.slice(0, end_index + 1).join(",");
- };
-
- var indent = (function () {
- var txt = '';
- var i;
- for (i = 0; i < spaces_per_indent; i++) {
- txt += ' ';
- }
- return txt;
- }());
-
- // Indent once for each indent_level
- var add_indent = function (txt, indent_level) {
- var k;
- for (k = 0; k < indent_level; k++) {
- txt += indent;
- }
- return txt;
- };
-
- // If it's not the last element of the name_arr, it's a testCase.
- var is_testCase = function (name_arr, index) {
- return index === name_arr.length - 1 ? false : true;
- };
-
- var testCase_line = function (txt) {
- return txt + "\n";
- };
-
- /**
- * Prints (console.log) the nested test status line(s).
- *
- * @param {Array} name_arr - Array of name elements.
- * @param {String} status - either 'pass' or 'fail'.
- * @example
- * > print_status(['TC1', 'TC1.1', 'mytest'], 'pass');
- * TC1
- * TC1.1
- * mytest (pass)
- */
- var print_status = function (name_arr, status) {
- var txt = '';
- var _name_slice, part, i;
- for (i = 0; i < name_arr.length; i++) {
- _name_slice = name_slice(name_arr, i);
- part = name_arr[i];
- if (!tracker.already_printed[_name_slice]) {
- txt = add_indent(txt, i);
- if (is_testCase(name_arr, i)) {
- txt += testCase_line(part);
- } else {
- txt += status_text(part, status);
- }
- tracker.already_printed[_name_slice] = true;
- }
- }
- console.log(txt);
- };
-
- nodeunit.runFiles(paths, {
- testspec: options.testspec,
- moduleStart: function (name) {
- console.log('\n' + bold(name));
- },
- testDone: function (name, assertions) {
- tracker.remove(name);
-
- if (!assertions.failures()) {
- print_status(name, 'pass');
- } else {
- print_status(name, 'fail');
- assertions.forEach(function (a) {
- if (a.failed()) {
- a = utils.betterErrors(a);
- if (a.error instanceof AssertionError && a.message) {
- console.log(
- 'Assertion Message: ' +
- assertion_message(a.message)
- );
- }
- console.log(a.error.stack + '\n');
- }
- });
- }
- },
- done: function (assertions, end) {
- end = end || new Date().getTime();
- var duration = end - start;
- if (assertions.failures()) {
- console.log(
- '\n' + bold(error('FAILURES: ')) + assertions.failures() +
- '/' + assertions.length + ' assertions failed (' +
- assertions.duration + 'ms)'
- );
- } else {
- console.log(
- '\n' + bold(ok('OK: ')) + assertions.length +
- ' assertions (' + assertions.duration + 'ms)'
- );
- }
- },
- testStart: function (name) {
- tracker.put(name);
- }
- });
-};
http://git-wip-us.apache.org/repos/asf/incubator-cordova-coho/blob/1d113e44/node_modules/nodeunit/dist/nodeunit/lib/reporters/skip_passed.js
----------------------------------------------------------------------
diff --git a/node_modules/nodeunit/dist/nodeunit/lib/reporters/skip_passed.js b/node_modules/nodeunit/dist/nodeunit/lib/reporters/skip_passed.js
deleted file mode 100644
index b39de41..0000000
--- a/node_modules/nodeunit/dist/nodeunit/lib/reporters/skip_passed.js
+++ /dev/null
@@ -1,107 +0,0 @@
-/*!
- * Nodeunit
- * Copyright (c) 2010 Caolan McMahon
- * MIT Licensed
- */
-
-/**
- * Module dependencies
- */
-
-var nodeunit = require('../nodeunit'),
- utils = require('../utils'),
- fs = require('fs'),
- path = require('path'),
- AssertionError = require('assert').AssertionError;
-
-/**
- * Reporter info string
- */
-
-exports.info = "Skip passed tests output";
-
-/**
- * Run all tests within each module, reporting the results to the command-line.
- *
- * @param {Array} files
- * @api public
- */
-
-exports.run = function (files, options, callback) {
-
- if (!options) {
- // load default options
- var content = fs.readFileSync(
- __dirname + '/../../bin/nodeunit.json', 'utf8'
- );
- options = JSON.parse(content);
- }
-
- var error = function (str) {
- return options.error_prefix + str + options.error_suffix;
- };
- var ok = function (str) {
- return options.ok_prefix + str + options.ok_suffix;
- };
- var bold = function (str) {
- return options.bold_prefix + str + options.bold_suffix;
- };
- var assertion_message = function (str) {
- return options.assertion_prefix + str + options.assertion_suffix;
- };
-
- var start = new Date().getTime();
- var paths = files.map(function (p) {
- return path.join(process.cwd(), p);
- });
-
- nodeunit.runFiles(paths, {
- testspec: options.testspec,
- moduleStart: function (name) {
- console.log('\n' + bold(name));
- },
- testDone: function (name, assertions) {
- if (assertions.failures()) {
- console.log(error('✖ ' + name) + '\n');
- assertions.forEach(function (a) {
- if (a.failed()) {
- a = utils.betterErrors(a);
- if (a.error instanceof AssertionError && a.message) {
- console.log(
- 'Assertion Message: ' + assertion_message(a.message)
- );
- }
- console.log(a.error.stack + '\n');
- }
- });
- }
- },
- moduleDone: function (name, assertions) {
- if (!assertions.failures()) {
- console.log('✔ all tests passed');
- }
- else {
- console.log(error('✖ some tests failed'));
- }
- },
- done: function (assertions) {
- var end = new Date().getTime();
- var duration = end - start;
- if (assertions.failures()) {
- console.log(
- '\n' + bold(error('FAILURES: ')) + assertions.failures() +
- '/' + assertions.length + ' assertions failed (' +
- assertions.duration + 'ms)'
- );
- }
- else {
- console.log(
- '\n' + bold(ok('OK: ')) + assertions.length +
- ' assertions (' + assertions.duration + 'ms)'
- );
- }
-
- if (callback) callback(assertions.failures() ? new Error('We have got test failures.') : undefined);
- }
- });
-};