Skip to content
This repository has been archived by the owner on May 20, 2019. It is now read-only.

Commit

Permalink
[#45,tests]: fix tests callback for node v0.10
Browse files Browse the repository at this point in the history
  • Loading branch information
alvaropinot committed Mar 30, 2016
1 parent ca85315 commit 376e576
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/all.js
Expand Up @@ -74,17 +74,18 @@ describe('validate', function() {
consoleLogSpy.restore();
});

it('should return valid with a valid datapackage.json', function() {
it('should return valid with a valid datapackage.json', function(done) {
var _dpm = new dpm({}, root);
var _path = path.resolve('test/fixtures/mydpkg-test');
return _dpm.validate(_path).then(function (results) {
assert.equal(results.valid, true);
assert.equal(results.errors.length, 0);
assert.ok(consoleLogSpy.calledWith('DataPackage.json is Valid'.green));
done();
});
});

it('should return invalid with a invalid datapackage.json', function() {
it('should return invalid with a invalid datapackage.json', function(done) {
var _dpm = new dpm({}, root);
var _path = path.resolve('test/fixtures/mydpkg-invalid-test');
var expectedResult = {
Expand All @@ -109,6 +110,7 @@ describe('validate', function() {
assert.equal(results.errors.length, 1);
assert.ok(consoleLogSpy.calledWith('DataPackage.json is Invalid'.red));
assert.ok(consoleLogSpy.calledWith(JSON.stringify(expectedResult, null, 2)));
done();
});
});
});

0 comments on commit 376e576

Please sign in to comment.