From 2eaff18be15a1b19e3b7c27d5204e94c66a557ca Mon Sep 17 00:00:00 2001 From: Irakli Gozalishvili Date: Fri, 5 Jun 2020 15:10:52 -0700 Subject: [PATCH] fix: lack of TextEncoder in older nodejs --- test/resolver.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/resolver.spec.js b/test/resolver.spec.js index 2818347..91391c3 100644 --- a/test/resolver.spec.js +++ b/test/resolver.spec.js @@ -55,8 +55,8 @@ describe('IPLD Format resolver (local)', () => { const dataLinksNodeBlobs = [ ['DAGNode', create(Buffer.from('aaah the data'), links)], ['{Data:Buffer}', createPlain(Buffer.from('aaah the data'), links)], - ['{data:ArrayBuffer}', createPlain(new TextEncoder().encode('aaah the data').buffer, links)], - ['{data:Uint8Array}', createPlain(new TextEncoder().encode('aaah the data'), links)] + ['{data:ArrayBuffer}', createPlain(Uint8Array.from(Buffer.from('aaah the data')).buffer, links)], + ['{data:Uint8Array}', createPlain(Uint8Array.from(Buffer.from('aaah the data')), links)] ] for (const [kind, emptyNodeBlob] of emptyNodeBlobs) {