From 6a8fe4dcaad0c9aeb7465a9d42a5bbbd2777db8b Mon Sep 17 00:00:00 2001 From: Aaron Meese Date: Sat, 30 Jul 2022 21:38:37 -0400 Subject: [PATCH] Fixed disabled VFS tests (#185) Fixes VFS tests that were commented out due to assertion issues relating to null byte characters not visible in console output, hence not caught. --- __tests__/utils/vfs.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/__tests__/utils/vfs.js b/__tests__/utils/vfs.js index a291d44..f37ade9 100644 --- a/__tests__/utils/vfs.js +++ b/__tests__/utils/vfs.js @@ -194,11 +194,10 @@ describe('utils.vfs#transformArrayBuffer', () => { const testAbString = ab2str(testAb); const create = type => vfs.transformArrayBuffer(testAb, 'text/plain', type); - /* FIXME test('Should create string', () => create('string') - .then(result => expect(result).toBe('foo'))); - */ + .then(result => result.replace(/\0/g, '')) + .then(result => expect(result).toBe(testText))); test('Should create data url', async () => { const result = await create('uri'); @@ -210,12 +209,11 @@ describe('utils.vfs#transformArrayBuffer', () => { expect(index).not.toBe(-1); }); - /* FIXME test('Should create blob', () => create('blob') .then(blob2str) + .then(result => result.replace(/\0/g, '')) .then(result => expect(result).toBe(testText))); - */ test('Should create arraybuffer (default)', () => create('arraybuffer')