Skip to content

Commit e802c3a

Browse files
committed
test: test more base64 codepaths on Node.js
1 parent b8a1e7c commit e802c3a

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

tests/base64.hermes.test.cjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Buffer.TYPED_ARRAY_SUPPORT = true
2+
delete globalThis.TextDecoder
3+
delete Uint8Array.prototype.toBase64
4+
delete Uint8Array.fromBase64
5+
6+
if (globalThis.HermesInternal) {
7+
// Test non-Hermes path on Hermes
8+
delete globalThis.HermesInternal
9+
} else {
10+
// And Hermes path on non-Hermes
11+
globalThis.HermesInternal = true
12+
}
13+
14+
require('./base64.test.js')

tests/base64.nobuf.test.cjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Buffer.TYPED_ARRAY_SUPPORT = true
2+
delete Uint8Array.prototype.toBase64
3+
delete Uint8Array.fromBase64
4+
require('./base64.test.js')

0 commit comments

Comments
 (0)