Skip to content

Commit

Permalink
Merge pull request #1369 from apiaryio/1368-sanitization-keys-assertion
Browse files Browse the repository at this point in the history
test: uses "hasAllKeys" for order-insensitive keys assertion
  • Loading branch information
artem-zakharchenko committed May 21, 2019
2 parents a6cab86 + 99bdc2e commit dee4218
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/integration/sanitation-test.js
Expand Up @@ -455,7 +455,7 @@ describe('Sanitation of Reported Data', () => {
assert.equal(events[2].test.status, 'fail');
assert.include(events[2].test.results.general.results[0].message.toLowerCase(), 'fail');
});
it('emitted test data results contain just \'general\' section', () => assert.deepEqual(Object.keys(events[2].test.results), ['general']));
it('emitted test data results contain just \'general\' section', () => assert.hasAllKeys(events[2].test.results, ['general']));
it('sensitive data cannot be found anywhere in the emitted test data', () => {
const test = JSON.stringify(events);
assert.notInclude(test, sensitiveKey);
Expand Down Expand Up @@ -494,7 +494,7 @@ describe('Sanitation of Reported Data', () => {
assert.equal(events[2].test.status, 'fail');
assert.include(events[2].test.results.general.results[0].message.toLowerCase(), 'fail');
});
it('emitted test data results contain all regular sections', () => assert.deepEqual(Object.keys(events[2].test.results), ['general', 'headers', 'body', 'statusCode']));
it('emitted test data results contain all regular sections', () => assert.hasAllKeys(events[2].test.results, ['general', 'headers', 'body', 'statusCode']));
it('sensitive data cannot be found anywhere in the emitted test data', () => {
const test = JSON.stringify(events);
assert.notInclude(test, sensitiveKey);
Expand Down Expand Up @@ -530,7 +530,7 @@ describe('Sanitation of Reported Data', () => {
]));
it('emitted test is skipped', () => {
assert.equal(events[2].test.status, 'skip');
assert.deepEqual(Object.keys(events[2].test.results), ['general']);
assert.hasAllKeys(events[2].test.results, ['general']);
assert.include(events[2].test.results.general.results[0].message.toLowerCase(), 'skip');
});
it('sensitive data cannot be found anywhere in the emitted test data', () => {
Expand Down

0 comments on commit dee4218

Please sign in to comment.