Skip to content

Commit efc86cd

Browse files
committed
Update validate spec to compare object by values
Tests started failing as object started to show up with 'toString'.
1 parent 6ab3bfc commit efc86cd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib/validate.spec.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import chai from 'chai';
22
import { describe, it} from 'mocha';
33
import { validate } from './validate';
44

5-
chai.should();
5+
let should = chai.should();
66

77
describe('validate.js', () => {
88
it('should hold a validation function for testing against tv4 until an option to pass in a validator is created', () => {
@@ -14,7 +14,10 @@ describe('validate.js', () => {
1414
it('should return a result object {"error":null, "missing":[], "valid":true}, with valid set to true when the data is valid for the schema', () => {
1515
let value = 'Batman';
1616
let result = validate(form, value);
17-
result.should.be.deep.equal({"error":null,"missing":[],"valid":true});
17+
should.not.exist(result.error);
18+
result.missing.should.be.a('array');
19+
result.missing.length.should.equal(0);
20+
result.valid.should.equal(true);
1821
});
1922

2023
it('should return an error object with a message "Invalid type: array (expected string)" when the data is not valid', () => {

0 commit comments

Comments
 (0)