Skip to content

Commit

Permalink
#11 Added testlig support
Browse files Browse the repository at this point in the history
  • Loading branch information
itayw committed Mar 2, 2014
1 parent 724b180 commit 1b4bfba
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/describejson.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ kindof = function (value) {
try {
var dt = new Date(value);
if (!isNaN(dt.getTime()))
ko = 'date'
ko = 'date';
}
catch (ex) {
//do nothing
Expand All @@ -23,7 +23,7 @@ kindof = function (value) {
dj.describe = function (obj) {
var described = traverse(obj).map(function (x) {
if (!this.isRoot && this.isLeaf) {
this.update(kindof(x))
this.update(kindof(x));
}
});

Expand Down
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
}
],
"scripts": {
"test": "make test",
"test": "mocha --ui bdd test/unit",
"test-lint": "make test",
"coveralls": "make coveralls"
},
"dependencies": {
Expand All @@ -41,5 +42,14 @@
"json",
"metadata"
],
"license": "MIT"
"license": "MIT",
"testling": {
"harness": "mocha-bdd",
"files": "test/unit/*.js",
"browsers": [
"ie/8..latest",
"chrome/latest",
"firefox/latest"
]
}
}
2 changes: 2 additions & 0 deletions test/harness.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require('./common');
require('./unit/basic.spec');
7 changes: 5 additions & 2 deletions test/unit/basic.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
var dj = require('../../lib/describejson');
var
assert = require('assert'),

dj = require('../../lib/describejson');

describe('given an object', function () {
before(function () {
Expand All @@ -14,7 +17,7 @@ describe('given an object', function () {
string: 'string',
date: new Date()
}
}
};
});

it("should describe a JSON object", function () {
Expand Down

0 comments on commit 1b4bfba

Please sign in to comment.