From c2b5c2e59e3a409ef7b734d5adb508af58f5e0da Mon Sep 17 00:00:00 2001 From: error Date: Sat, 21 Jul 2018 14:53:17 -0500 Subject: [PATCH] fix #719 --- src/util.js | 2 +- test/unit/util.test.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util.js b/src/util.js index 9720f24f444..b4700c5ae93 100644 --- a/src/util.js +++ b/src/util.js @@ -194,7 +194,7 @@ export function validateCouchDBString(name) { const regStr = '^[a-z][a-z0-9]*$'; const reg = new RegExp(regStr); if (!name.match(reg)) { - throw new RxError.newRxError('UT2', { + throw RxError.newRxError('UT2', { regex: regStr, givenName: name, }); diff --git a/test/unit/util.test.js b/test/unit/util.test.js index 05e8205e905..aae0cc29f6a 100644 --- a/test/unit/util.test.js +++ b/test/unit/util.test.js @@ -73,7 +73,8 @@ describe('util.test.js', () => { describe('negative', () => { it('should not validate a spaced string', () => { assert.throws( - () => util.validateCouchDBString('foo bar') + () => util.validateCouchDBString('foo bar'), + { code: 'UT2' } ); }); });