All tests now using common.require() to prepare for client-side testing
parent
a3cf31aa40
commit
98fd1e7c7c
|
@ -22,5 +22,25 @@
|
|||
* @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
|
||||
*/
|
||||
|
||||
require( './common' );
|
||||
|
||||
var assert = require( 'assert' ),
|
||||
Class = require( '../lib/class' ),
|
||||
abstractMethod = require( '../lib/class' ).abstractMethod,
|
||||
util = require( '../lib/util' );
|
||||
var common = require( './common' ),
|
||||
assert = require( 'assert' ),
|
||||
Class = common.require( 'class' ),
|
||||
abstractMethod = common.require( 'class' ).abstractMethod,
|
||||
util = common.require( 'util' );
|
||||
|
||||
// not abstract
|
||||
var Foo = Class.extend( {} );
|
||||
|
|
|
@ -22,10 +22,9 @@
|
|||
* @package test
|
||||
*/
|
||||
|
||||
require( './common' );
|
||||
|
||||
var assert = require( 'assert' ),
|
||||
Class = require( '../lib/class' );
|
||||
var common = require( './common' ),
|
||||
assert = require( 'assert' ),
|
||||
Class = common.require( 'class' );
|
||||
|
||||
// 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
|
||||
|
|
|
@ -22,10 +22,9 @@
|
|||
* @package test
|
||||
*/
|
||||
|
||||
require( './common' );
|
||||
|
||||
var assert = require( 'assert' ),
|
||||
Class = require( '../lib/class' );
|
||||
var common = require( './common' ),
|
||||
assert = require( 'assert' ),
|
||||
Class = common.require( 'class' );
|
||||
|
||||
var foo_props = {
|
||||
one: 1,
|
||||
|
|
|
@ -28,10 +28,9 @@ if ( Object.prototype.__defineGetter__ === undefined )
|
|||
return;
|
||||
}
|
||||
|
||||
require( './common' );
|
||||
|
||||
var assert = require( 'assert' ),
|
||||
Class = require( '../lib/class' );
|
||||
var common = require( './common' ),
|
||||
assert = require( 'assert' ),
|
||||
Class = common.require( 'class' );
|
||||
|
||||
|
||||
var Foo = Class.extend(
|
||||
|
|
|
@ -22,10 +22,9 @@
|
|||
* @package test
|
||||
*/
|
||||
|
||||
require( './common' );
|
||||
|
||||
var assert = require( 'assert' ),
|
||||
Class = require( '../lib/class' );
|
||||
var common = require( './common' ),
|
||||
assert = require( 'assert' ),
|
||||
Class = common.require( 'class' );
|
||||
|
||||
var Foo = Class.extend(
|
||||
{
|
||||
|
|
|
@ -22,10 +22,9 @@
|
|||
* @package test
|
||||
*/
|
||||
|
||||
require( './common' );
|
||||
|
||||
var assert = require( 'assert' ),
|
||||
Class = require( '../lib/class' );
|
||||
var common = require( './common' ),
|
||||
assert = require( 'assert' ),
|
||||
Class = common.require( 'class' );
|
||||
|
||||
|
||||
assert.ok(
|
||||
|
|
|
@ -22,10 +22,9 @@
|
|||
* @package test
|
||||
*/
|
||||
|
||||
require( './common' );
|
||||
|
||||
var assert = require( 'assert' ),
|
||||
Class = require( '../lib/class' ),
|
||||
var common = require( './common' ),
|
||||
assert = require( 'assert' ),
|
||||
Class = common.require( 'class' ),
|
||||
Script = process.binding( 'evals' ).Script,
|
||||
sandbox = {};
|
||||
|
||||
|
|
|
@ -22,10 +22,9 @@
|
|||
* @package test
|
||||
*/
|
||||
|
||||
require( './common' );
|
||||
|
||||
var assert = require( 'assert' ),
|
||||
Class = require( '../lib/class' ),
|
||||
var common = require( './common' ),
|
||||
assert = require( 'assert' ),
|
||||
Class = common.require( 'class' ),
|
||||
index = require( '../' );
|
||||
|
||||
|
||||
|
|
|
@ -22,10 +22,9 @@
|
|||
* @package test
|
||||
*/
|
||||
|
||||
require( './common' );
|
||||
|
||||
var assert = require( 'assert' ),
|
||||
Interface = require( '../lib/interface' ),
|
||||
var common = require( './common' ),
|
||||
assert = require( 'assert' ),
|
||||
Interface = common.require( 'interface' ),
|
||||
abstractMethod = Interface.abstractMethod;
|
||||
|
||||
|
||||
|
|
|
@ -22,10 +22,9 @@
|
|||
* @package test
|
||||
*/
|
||||
|
||||
require( './common' );
|
||||
|
||||
var assert = require( 'assert' ),
|
||||
Interface = require( '../lib/interface' ),
|
||||
var common = require( './common' ),
|
||||
assert = require( 'assert' ),
|
||||
Interface = common.require( 'interface' ),
|
||||
abstractMethod = Interface.abstractMethod;
|
||||
|
||||
var FooType = Interface.extend();
|
||||
|
|
|
@ -22,10 +22,9 @@
|
|||
* @package test
|
||||
*/
|
||||
|
||||
require( './common' );
|
||||
|
||||
var assert = require( 'assert' ),
|
||||
util = require( '../lib/util' );
|
||||
var common = require( './common' ),
|
||||
assert = require( 'assert' ),
|
||||
util = common.require( 'util' );
|
||||
|
||||
var arr = [ 1, 2, 3 ],
|
||||
obj = { a: 1, b: 2 };
|
||||
|
|
|
@ -22,10 +22,9 @@
|
|||
* @package test
|
||||
*/
|
||||
|
||||
require( './common' );
|
||||
|
||||
var assert = require( 'assert' ),
|
||||
util = require( '../lib/util' );
|
||||
var common = require( './common' ),
|
||||
assert = require( 'assert' ),
|
||||
util = common.require( 'util' );
|
||||
|
||||
var obj = {},
|
||||
val = 'bar';
|
||||
|
|
|
@ -22,10 +22,9 @@
|
|||
* @package test
|
||||
*/
|
||||
|
||||
require( './common' );
|
||||
|
||||
var assert = require( 'assert' ),
|
||||
propCopy = require( '../lib/util' ).propCopy;
|
||||
var common = require( './common' ),
|
||||
assert = require( 'assert' ),
|
||||
propCopy = common.require( 'util' ).propCopy;
|
||||
|
||||
var props = {
|
||||
one: 1,
|
||||
|
|
|
@ -22,10 +22,9 @@
|
|||
* @package test
|
||||
*/
|
||||
|
||||
require( './common' );
|
||||
|
||||
var assert = require( 'assert' ),
|
||||
util = require( '../lib/util' );
|
||||
var common = require( './common' ),
|
||||
assert = require( 'assert' ),
|
||||
util = common.require( 'util' );
|
||||
|
||||
var data = {
|
||||
// scalars (properties)
|
||||
|
|
Loading…
Reference in New Issue