Make tests all green, now the real work begins
This commit is contained in:
parent
b27756abfc
commit
1a63cefd60
|
@ -21,7 +21,7 @@ namespace("Cylon.Adaptors", function() {
|
|||
subclass(Loopback, klass);
|
||||
|
||||
function Loopback() {
|
||||
_ref = Loopback.__super__.constructor.apply(this, arguments);
|
||||
var _ref = Loopback.__super__.constructor.apply(this, arguments);
|
||||
return _ref;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace("Cylon.Drivers", function() {
|
|||
subclass(Ping, klass);
|
||||
|
||||
function Ping() {
|
||||
_ref = Ping.__super__.constructor.apply(this, arguments);
|
||||
var _ref = Ping.__super__.constructor.apply(this, arguments);
|
||||
return _ref;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,46 +2,32 @@
|
|||
* Test driver
|
||||
* cylonjs.com
|
||||
*
|
||||
* Copyright (c) 2013 The Hybrid Group
|
||||
* Copyright (c) 2013-2014 The Hybrid Group
|
||||
* Licensed under the Apache 2.0 license.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
var namespace,
|
||||
__slice = [].slice,
|
||||
__hasProp = {}.hasOwnProperty,
|
||||
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
||||
var namespace = require('node-namespace');
|
||||
|
||||
namespace = require('node-namespace');
|
||||
module.exports = {
|
||||
driver: function(opts) {
|
||||
return new Cylon.Drivers.TestDriver(opts);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
driver: function() {
|
||||
var args;
|
||||
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
|
||||
return (function(func, args, ctor) {
|
||||
ctor.prototype = func.prototype;
|
||||
var child = new ctor, result = func.apply(child, args);
|
||||
return Object(result) === result ? result : child;
|
||||
})(Cylon.Drivers.TestDriver, args, function(){});
|
||||
}
|
||||
};
|
||||
namespace("Cylon.Drivers", function() {
|
||||
this.TestDriver = (function(klass) {
|
||||
subclass(TestDriver, klass);
|
||||
|
||||
namespace('Cylon.Drivers', function() {
|
||||
return this.TestDriver = (function(_super) {
|
||||
__extends(TestDriver, _super);
|
||||
|
||||
function TestDriver(opts) {
|
||||
if (opts == null) {
|
||||
opts = {};
|
||||
}
|
||||
TestDriver.__super__.constructor.apply(this, arguments);
|
||||
function TestDriver(opts) {
|
||||
if (opts == null) {
|
||||
opts = {};
|
||||
}
|
||||
TestDriver.__super__.constructor.apply(this, arguments);
|
||||
}
|
||||
|
||||
return TestDriver;
|
||||
return TestDriver;
|
||||
|
||||
})(Cylon.Driver);
|
||||
});
|
||||
|
||||
}).call(this);
|
||||
})(Cylon.Driver);
|
||||
});
|
||||
|
|
12
package.json
12
package.json
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "cylon",
|
||||
"version": "0.10.4",
|
||||
"main": "dist/cylon.js",
|
||||
"main": "lib/cylon.js",
|
||||
"description": "A JavaScript robotics framework using Node.js",
|
||||
"homepage": "http://cylonjs.com",
|
||||
"bugs": "https://github.com/hybridgroup/cylon/issues",
|
||||
|
@ -24,19 +24,13 @@
|
|||
"./": false,
|
||||
"async": true,
|
||||
"node-namespace": true,
|
||||
"./dist": true,
|
||||
"./dist/cli": false
|
||||
"./lib": true,
|
||||
"./lib/cli": false
|
||||
},
|
||||
"bin": {
|
||||
"cylon": "./bin/cylon"
|
||||
},
|
||||
"devDependencies": {
|
||||
"matchdep": "~0.1.1",
|
||||
"grunt-contrib-jshint": "~0.6.0",
|
||||
"grunt-contrib-watch": "~0.5.0",
|
||||
"grunt-contrib-coffee": "~0.7.0",
|
||||
"grunt-simple-mocha": "~0.4.0",
|
||||
"grunt-contrib-clean": "~0.5.0",
|
||||
"sinon-chai": "~2.4.0",
|
||||
"chai": "~1.7.2",
|
||||
"mocha": "~1.12.1",
|
||||
|
|
|
@ -8,18 +8,23 @@ var path = require('path');
|
|||
var chai = require('chai');
|
||||
var sinonChai = require('sinon-chai');
|
||||
|
||||
require('cylon');
|
||||
Logger.setup(false) // disable Cylon's logger for tests
|
||||
|
||||
global.chai = chai;
|
||||
global.should = chai.should();
|
||||
global.expect = chai.expect;
|
||||
global.assert = chai.assert;
|
||||
global.AssertionError = chai.AssertionError;
|
||||
global.sinon = require('sinon');
|
||||
global.spy = sinon.spy
|
||||
global.stub = sinon.stub
|
||||
|
||||
// can be used by test modules to require production modules,
|
||||
// relative to the base path (where the Gruntfile.js also lives)
|
||||
global.source = function (src) {
|
||||
console.log('source loading: ' + src)
|
||||
var resource = path.normalize('../../dist/' + src);
|
||||
var resource = path.normalize('../../lib/' + src);
|
||||
|
||||
return require(resource);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue