From fe55c4f8adea11ade611d5b526793fc91c8e24a7 Mon Sep 17 00:00:00 2001 From: Olivier Lalonde Date: Sat, 5 Nov 2016 14:27:58 -0700 Subject: [PATCH] fix(utf8): added one more utf8 test --- src/tests/index.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/tests/index.js b/src/tests/index.js index 8858cc7..b023e41 100644 --- a/src/tests/index.js +++ b/src/tests/index.js @@ -10,8 +10,7 @@ import { RandomStream } from 'common-streams' const noop = async () => {} -export default ({ - setup = noop, +export default ({ setup = noop, teardown = noop, } = {}) => { let store @@ -153,6 +152,17 @@ export default ({ t.equal(metadata.nonlatin, nonlatin) }) + test('utf-8 chars in metadata', async (t) => { + const uploadLength = 'bar'.length + const nonlatin = '大井っち.jpeg' + const { uploadId } = await store.create('foo', { + uploadLength, + metadata: { nonlatin }, + }) + const { metadata } = await store.info(uploadId) + t.equal(metadata.nonlatin, nonlatin) + }) + test('beforeComplete is called', async (t) => { const uploadLength = 'woot'.length const { uploadId } = await store.create('foo', {