File tree 5 files changed +43
-2
lines changed
5 files changed +43
-2
lines changed Original file line number Diff line number Diff line change 50
50
"npm-run-all" : " ~4.1.5" ,
51
51
"prettier" : " ^1.19.1" ,
52
52
"rimraf" : " ~3.0.0" ,
53
+ "ts-jest" : " ^27.1.3" ,
53
54
"ts-node" : " ~8.5.2" ,
54
55
"tslint" : " ~5.20.1" ,
55
- "typescript" : " ~3.8.3" ,
56
- "ts-jest" : " ^27.1.3"
56
+ "typescript" : " ~3.8.3"
57
57
},
58
58
"dependencies" : {
59
+ "@types/atob" : " ^2.1.2" ,
60
+ "atob" : " ^2.1.2" ,
59
61
"ethereum-cryptography" : " ^1.0.1" ,
60
62
"node-fetch" : " ^2.6.0"
61
63
},
Original file line number Diff line number Diff line change
1
+ import '../utils/shim' ;
1
2
import { TokenModule } from '../modules/token' ;
2
3
import { UsersModule } from '../modules/users' ;
3
4
import { UtilsModule } from '../modules/utils' ;
Original file line number Diff line number Diff line change
1
+ import atob from 'atob' ;
2
+
3
+ // Shims for atob being undefined in node.js prior version 14
4
+ if ( ! globalThis . atob ) globalThis . atob = atob ;
Original file line number Diff line number Diff line change
1
+ import atob from 'atob' ;
2
+
3
+ test ( '#01: Shim overwrites undefined global atob' , async ( ) => {
4
+ globalThis . atob = undefined ;
5
+
6
+ expect ( globalThis . atob ) . toBeUndefined ( ) ;
7
+
8
+ // eslint-disable-next-line global-require
9
+ require ( '../../../src/utils/shim' ) ;
10
+
11
+ expect ( globalThis . atob ) . toBe ( atob ) ;
12
+ } ) ;
13
+
14
+ test ( '#02: Shim does not overwrite exisiting atob' , async ( ) => {
15
+ const dummyFunc = ( ) => '' ;
16
+ globalThis . atob = dummyFunc ;
17
+
18
+ expect ( globalThis . atob ) . toBe ( dummyFunc ) ;
19
+
20
+ // eslint-disable-next-line global-require
21
+ require ( '../../../src/utils/shim' ) ;
22
+
23
+ expect ( globalThis . atob ) . toBe ( dummyFunc ) ;
24
+ } ) ;
Original file line number Diff line number Diff line change 821
821
resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82"
822
822
integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==
823
823
824
+ " @types/atob@^2.1.2 " :
825
+ version "2.1.2"
826
+ resolved "https://registry.yarnpkg.com/@types/atob/-/atob-2.1.2.tgz#157eb0cc46264a8c55f2273a836c7a1a644fb820"
827
+ integrity sha512-8GAYQ1jDRUQkSpHzJUqXwAkYFOxuWAOGLhIR4aPd/Y/yL12Q/9m7LsKpHKlfKdNE/362Hc9wPI1Yh6opDfxVJg==
828
+
824
829
" @types/babel__core@^7.0.0" , "@types/babel__core@^7.1.14":
825
830
version "7.1.18"
826
831
resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.18.tgz#1a29abcc411a9c05e2094c98f9a1b7da6cdf49f8"
@@ -1227,6 +1232,11 @@ asynckit@^0.4.0:
1227
1232
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
1228
1233
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=
1229
1234
1235
+ atob@^2.1.2 :
1236
+ version "2.1.2"
1237
+ resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
1238
+ integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
1239
+
1230
1240
author-regex@^1.0.0 :
1231
1241
version "1.0.0"
1232
1242
resolved "https://registry.yarnpkg.com/author-regex/-/author-regex-1.0.0.tgz#d08885be6b9bbf9439fe087c76287245f0a81450"
You can’t perform that action at this time.
0 commit comments