test: use is_browser instead of try/catch to detect browser.
This commit is contained in:
parent
7367d39592
commit
1c264deb2c
4 changed files with 14 additions and 8 deletions
|
|
@ -19,9 +19,11 @@ CryptoJS.AES.decrypt = function(a) {
|
|||
'use strict';
|
||||
var chai = chai || require('chai');
|
||||
var should = chai.should();
|
||||
try {
|
||||
var is_browser = typeof process == 'undefined'
|
||||
|| typeof process.versions === 'undefined';
|
||||
if (is_browser) {
|
||||
var copay = require('copay'); //browser
|
||||
} catch (e) {
|
||||
} else {
|
||||
var copay = require('../copay'); //node
|
||||
}
|
||||
var LocalEncrypted = copay.StorageLocalEncrypted;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue