diff options
author | tmashuang <thomas.b.huang@gmail.com> | 2018-09-25 00:28:04 +0800 |
---|---|---|
committer | tmashuang <thomas.b.huang@gmail.com> | 2018-09-25 00:28:04 +0800 |
commit | a0a57c24fd639c4808ed3e083089b9f1fb3373e6 (patch) | |
tree | 5a009cacab793398b1749e0d1e5af17c79af6322 /test/unit/app | |
parent | 82ec86d953cb22d36f9b67d35e3d994d7d2d245d (diff) | |
download | tangerine-wallet-browser-a0a57c24fd639c4808ed3e083089b9f1fb3373e6.tar tangerine-wallet-browser-a0a57c24fd639c4808ed3e083089b9f1fb3373e6.tar.gz tangerine-wallet-browser-a0a57c24fd639c4808ed3e083089b9f1fb3373e6.tar.bz2 tangerine-wallet-browser-a0a57c24fd639c4808ed3e083089b9f1fb3373e6.tar.lz tangerine-wallet-browser-a0a57c24fd639c4808ed3e083089b9f1fb3373e6.tar.xz tangerine-wallet-browser-a0a57c24fd639c4808ed3e083089b9f1fb3373e6.tar.zst tangerine-wallet-browser-a0a57c24fd639c4808ed3e083089b9f1fb3373e6.zip |
Some Ui tests
Diffstat (limited to 'test/unit/app')
-rw-r--r-- | test/unit/app/cleanErrorStack.spec.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/unit/app/cleanErrorStack.spec.js b/test/unit/app/cleanErrorStack.spec.js new file mode 100644 index 000000000..7a1ab1ed8 --- /dev/null +++ b/test/unit/app/cleanErrorStack.spec.js @@ -0,0 +1,33 @@ +const assert = require('assert') +const cleanErrorStack = require('../../../app/scripts/lib/cleanErrorStack') + +describe('Clean Error Stack', () => { + + const testMessage = 'Test Message' + const testError = new Error(testMessage) + const undefinedErrorName = new Error(testMessage) + const blankErrorName = new Error(testMessage) + const blankMsgError = new Error() + + beforeEach(() => { + undefinedErrorName.name = undefined + blankErrorName.name = '' + }) + + it('tests error with message', () => { + assert.equal(cleanErrorStack(testError), 'Error: Test Message') + }) + + it('tests error with undefined name', () => { + assert.equal(cleanErrorStack(undefinedErrorName).toString(), 'Error: Test Message') + }) + + it('tests error with blank name', () => { + assert.equal(cleanErrorStack(blankErrorName).toString(), 'Test Message') + }) + + it('tests error with blank message', () => { + assert.equal(cleanErrorStack(blankMsgError), 'Error') + }) + +}) |