All tests now using common.require() to prepare for client-side testing
parent
a3cf31aa40
commit
98fd1e7c7c
|
@ -22,5 +22,25 @@
|
||||||
* @package test
|
* @package test
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// may be implemented in the future
|
/**
|
||||||
|
* Library path
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
exports.PATH_LIB = require( 'path' ).normalize( __dirname + '/../lib' );
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns requested module from the library path
|
||||||
|
*
|
||||||
|
* This method abstracts require() implementation so that the tests may be more
|
||||||
|
* easily implemented elsewhere (e.g. client-side)
|
||||||
|
*
|
||||||
|
* @param {string} module module id
|
||||||
|
*
|
||||||
|
* @return {Object} module exports
|
||||||
|
*/
|
||||||
|
exports.require = function( module )
|
||||||
|
{
|
||||||
|
return require( exports.PATH_LIB + '/' + module );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,12 +22,11 @@
|
||||||
* @package test
|
* @package test
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require( './common' );
|
var common = require( './common' ),
|
||||||
|
assert = require( 'assert' ),
|
||||||
var assert = require( 'assert' ),
|
Class = common.require( 'class' ),
|
||||||
Class = require( '../lib/class' ),
|
abstractMethod = common.require( 'class' ).abstractMethod,
|
||||||
abstractMethod = require( '../lib/class' ).abstractMethod,
|
util = common.require( 'util' );
|
||||||
util = require( '../lib/util' );
|
|
||||||
|
|
||||||
// not abstract
|
// not abstract
|
||||||
var Foo = Class.extend( {} );
|
var Foo = Class.extend( {} );
|
||||||
|
|
|
@ -22,10 +22,9 @@
|
||||||
* @package test
|
* @package test
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require( './common' );
|
var common = require( './common' ),
|
||||||
|
assert = require( 'assert' ),
|
||||||
var assert = require( 'assert' ),
|
Class = common.require( 'class' );
|
||||||
Class = require( '../lib/class' );
|
|
||||||
|
|
||||||
// these two variables are declared outside of the class to ensure that they
|
// these two variables are declared outside of the class to ensure that they
|
||||||
// will still be set even if the context of the constructor is wrong
|
// will still be set even if the context of the constructor is wrong
|
||||||
|
|
|
@ -22,10 +22,9 @@
|
||||||
* @package test
|
* @package test
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require( './common' );
|
var common = require( './common' ),
|
||||||
|
assert = require( 'assert' ),
|
||||||
var assert = require( 'assert' ),
|
Class = common.require( 'class' );
|
||||||
Class = require( '../lib/class' );
|
|
||||||
|
|
||||||
var foo_props = {
|
var foo_props = {
|
||||||
one: 1,
|
one: 1,
|
||||||
|
|
|
@ -28,10 +28,9 @@ if ( Object.prototype.__defineGetter__ === undefined )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
require( './common' );
|
var common = require( './common' ),
|
||||||
|
assert = require( 'assert' ),
|
||||||
var assert = require( 'assert' ),
|
Class = common.require( 'class' );
|
||||||
Class = require( '../lib/class' );
|
|
||||||
|
|
||||||
|
|
||||||
var Foo = Class.extend(
|
var Foo = Class.extend(
|
||||||
|
|
|
@ -22,10 +22,9 @@
|
||||||
* @package test
|
* @package test
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require( './common' );
|
var common = require( './common' ),
|
||||||
|
assert = require( 'assert' ),
|
||||||
var assert = require( 'assert' ),
|
Class = common.require( 'class' );
|
||||||
Class = require( '../lib/class' );
|
|
||||||
|
|
||||||
var Foo = Class.extend(
|
var Foo = Class.extend(
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,10 +22,9 @@
|
||||||
* @package test
|
* @package test
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require( './common' );
|
var common = require( './common' ),
|
||||||
|
assert = require( 'assert' ),
|
||||||
var assert = require( 'assert' ),
|
Class = common.require( 'class' );
|
||||||
Class = require( '../lib/class' );
|
|
||||||
|
|
||||||
|
|
||||||
assert.ok(
|
assert.ok(
|
||||||
|
|
|
@ -22,10 +22,9 @@
|
||||||
* @package test
|
* @package test
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require( './common' );
|
var common = require( './common' ),
|
||||||
|
assert = require( 'assert' ),
|
||||||
var assert = require( 'assert' ),
|
Class = common.require( 'class' ),
|
||||||
Class = require( '../lib/class' ),
|
|
||||||
Script = process.binding( 'evals' ).Script,
|
Script = process.binding( 'evals' ).Script,
|
||||||
sandbox = {};
|
sandbox = {};
|
||||||
|
|
||||||
|
|
|
@ -22,10 +22,9 @@
|
||||||
* @package test
|
* @package test
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require( './common' );
|
var common = require( './common' ),
|
||||||
|
assert = require( 'assert' ),
|
||||||
var assert = require( 'assert' ),
|
Class = common.require( 'class' ),
|
||||||
Class = require( '../lib/class' ),
|
|
||||||
index = require( '../' );
|
index = require( '../' );
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,10 +22,9 @@
|
||||||
* @package test
|
* @package test
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require( './common' );
|
var common = require( './common' ),
|
||||||
|
assert = require( 'assert' ),
|
||||||
var assert = require( 'assert' ),
|
Interface = common.require( 'interface' ),
|
||||||
Interface = require( '../lib/interface' ),
|
|
||||||
abstractMethod = Interface.abstractMethod;
|
abstractMethod = Interface.abstractMethod;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,10 +22,9 @@
|
||||||
* @package test
|
* @package test
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require( './common' );
|
var common = require( './common' ),
|
||||||
|
assert = require( 'assert' ),
|
||||||
var assert = require( 'assert' ),
|
Interface = common.require( 'interface' ),
|
||||||
Interface = require( '../lib/interface' ),
|
|
||||||
abstractMethod = Interface.abstractMethod;
|
abstractMethod = Interface.abstractMethod;
|
||||||
|
|
||||||
var FooType = Interface.extend();
|
var FooType = Interface.extend();
|
||||||
|
|
|
@ -22,10 +22,9 @@
|
||||||
* @package test
|
* @package test
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require( './common' );
|
var common = require( './common' ),
|
||||||
|
assert = require( 'assert' ),
|
||||||
var assert = require( 'assert' ),
|
util = common.require( 'util' );
|
||||||
util = require( '../lib/util' );
|
|
||||||
|
|
||||||
var arr = [ 1, 2, 3 ],
|
var arr = [ 1, 2, 3 ],
|
||||||
obj = { a: 1, b: 2 };
|
obj = { a: 1, b: 2 };
|
||||||
|
|
|
@ -22,10 +22,9 @@
|
||||||
* @package test
|
* @package test
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require( './common' );
|
var common = require( './common' ),
|
||||||
|
assert = require( 'assert' ),
|
||||||
var assert = require( 'assert' ),
|
util = common.require( 'util' );
|
||||||
util = require( '../lib/util' );
|
|
||||||
|
|
||||||
var obj = {},
|
var obj = {},
|
||||||
val = 'bar';
|
val = 'bar';
|
||||||
|
|
|
@ -22,10 +22,9 @@
|
||||||
* @package test
|
* @package test
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require( './common' );
|
var common = require( './common' ),
|
||||||
|
assert = require( 'assert' ),
|
||||||
var assert = require( 'assert' ),
|
propCopy = common.require( 'util' ).propCopy;
|
||||||
propCopy = require( '../lib/util' ).propCopy;
|
|
||||||
|
|
||||||
var props = {
|
var props = {
|
||||||
one: 1,
|
one: 1,
|
||||||
|
|
|
@ -22,10 +22,9 @@
|
||||||
* @package test
|
* @package test
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require( './common' );
|
var common = require( './common' ),
|
||||||
|
assert = require( 'assert' ),
|
||||||
var assert = require( 'assert' ),
|
util = common.require( 'util' );
|
||||||
util = require( '../lib/util' );
|
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
// scalars (properties)
|
// scalars (properties)
|
||||||
|
|
Loading…
Reference in New Issue