UNPKG

760 BJavaScriptView Raw
1'use strict';
2
3const should = require('should');
4const helper = require('./_helper');
5
6describe('sanitization', function () {
7
8 it('should do no harm to original object', function (done) {
9 let bar = {
10 password: 'pass',
11 password_salt: 'salt'
12 },
13 config = {
14 key: 'key',
15 secret: 'secret'
16 },
17 pubsub = helper.createMockClient(config, function sender(event) {
18 should(event.event).be.equal('foo');
19 should(event).have.property('data');
20 should(event.data).have.property('password', '[HIDDEN]');
21 should(event.data).have.property('password_salt', '[HIDDEN]');
22 should(bar).have.property('password', 'pass');
23 should(bar).have.property('password_salt', 'salt');
24 done();
25 });
26 pubsub.publish('foo', bar);
27 });
28
29});