har-validator
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"name": "har-validator", | ||
@@ -30,9 +30,9 @@ "description": "HTTP Archive (HAR) validator using JSON Schema", | ||
"mocha": "^2.1.0", | ||
"should": "^4.6.1" | ||
"should": "^5.0.1" | ||
}, | ||
"dependencies": { | ||
"chalk": "^0.5.1", | ||
"chalk": "^1.0.0", | ||
"commander": "^2.6.0", | ||
"is-my-json-valid": "^2.4.0" | ||
"is-my-json-valid": "^2.9.4" | ||
} | ||
} |
@@ -7,4 +7,10 @@ 'use strict'; | ||
module.exports = function (data, cb) { | ||
if (!data) { | ||
return false; | ||
} | ||
// execute is-my-json-valid | ||
var valid = validate(data); | ||
// callback? | ||
if (cb) { | ||
@@ -11,0 +17,0 @@ return cb(validate.errors, valid); |
@@ -41,10 +41,7 @@ { | ||
"properties": { | ||
"startedDateTime": { | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"id": { "type": "string", "unique": true }, | ||
"title": { "type": "string" }, | ||
"pageTimings": { "$ref": "#/definitions/pageTimings" }, | ||
"comment": { "type": "string" } | ||
"startedDateTime": { "type": "string", "format": "date-time" }, | ||
"id": { "type": "string", "unique": true }, | ||
"title": { "type": "string" }, | ||
"pageTimings": { "$ref": "#/definitions/pageTimings" }, | ||
"comment": { "type": "string" } | ||
} | ||
@@ -68,6 +65,3 @@ }, | ||
"pageref": { "type": "string" }, | ||
"startedDateTime": { | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"startedDateTime": { "type": "string", "format": "date-time" }, | ||
"time": { "type": "number", "min": 0 }, | ||
@@ -78,3 +72,3 @@ "request": { "$ref": "#/definitions/request" }, | ||
"timings": { "$ref": "#/definitions/timings" }, | ||
"serverIPAddress": { "type": "string" }, | ||
"serverIPAddress": { "type": "string", "format": "ipv4" }, | ||
"connection": { "type": "string" }, | ||
@@ -90,3 +84,3 @@ "comment": { "type": "string" } | ||
"method": { "type": "string" }, | ||
"url": { "type": "string" }, | ||
"url": { "type": "string", "format": "uri" }, | ||
"httpVersion": { "type": "string" }, | ||
@@ -200,5 +194,5 @@ "cookies": { | ||
"properties": { | ||
"beforeRequest": { "$ref": "#/definitions/cacheEntry" }, | ||
"afterRequest": { "$ref": "#/definitions/cacheEntry" }, | ||
"comment": { "type": "string" } | ||
"beforeRequest": { "$ref": "#/definitions/cacheEntry" }, | ||
"afterRequest": { "$ref": "#/definitions/cacheEntry" }, | ||
"comment": { "type": "string" } | ||
} | ||
@@ -205,0 +199,0 @@ }, |
@@ -11,4 +11,6 @@ 'use strict'; | ||
validate({}, function (err, valid) { | ||
valid.should.be.false; | ||
err[0].should.have.property('message'); | ||
err[0].message.should.equal('missing required properties'); | ||
err[0].message.should.equal('is required'); | ||
}); | ||
@@ -21,4 +23,6 @@ | ||
validate([], function (err, valid) { | ||
valid.should.be.false; | ||
err[0].should.have.property('message'); | ||
err[0].message.should.equal('missing required properties'); | ||
err[0].message.should.equal('is the wrong type'); | ||
}); | ||
@@ -29,2 +33,10 @@ | ||
it('should fail with undefined', function (done) { | ||
validate(undefined, function (err, valid) { | ||
valid.should.be.false; | ||
}); | ||
done(); | ||
}); | ||
it('should fail on bad "log.version"', function (done) { | ||
@@ -31,0 +43,0 @@ validate(fixtures.invalid.version, function (err, valid) { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17334
417
+ Addedansi-regex@2.1.1(transitive)
+ Addedansi-styles@2.2.1(transitive)
+ Addedchalk@1.1.3(transitive)
+ Addedhas-ansi@2.0.0(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedsupports-color@2.0.0(transitive)
- Removedansi-regex@0.2.1(transitive)
- Removedansi-styles@1.1.0(transitive)
- Removedchalk@0.5.1(transitive)
- Removedhas-ansi@0.1.0(transitive)
- Removedstrip-ansi@0.3.0(transitive)
- Removedsupports-color@0.2.0(transitive)
Updatedchalk@^1.0.0
Updatedis-my-json-valid@^2.9.4