Skip to content

Commit 1a3f078

Browse files
authored
fix(unit tests): Make test assertion for json schema validation failure less specific (#358)
Summary: A new patch version of json-schema was released that changed an error message. Our test specifically asserts on the old version of the error message. With this change we assert on a substring that's included in both the old & new versions. Test plan: Run unit tests
1 parent 0eb3ba3 commit 1a3f078

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/optimizely-sdk/lib/utils/json_schema_validator/index.tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe('lib/utils/json_schema_validator', function() {
3232
it('should throw an error if the object is not valid', function() {
3333
assert.throws(function() {
3434
jsonSchemaValidator.validate({'type': 'number'}, 'not a number');
35-
}, sprintf(ERROR_MESSAGES.INVALID_DATAFILE, 'JSON_SCHEMA_VALIDATOR', '', 'string value found, but a number is required'));
35+
}, 'string value found, but a number is required');
3636
});
3737

3838
it('should throw an error if no schema is passed in', function() {

0 commit comments

Comments
 (0)