diff options
Diffstat (limited to 'fastify-busboy/test/dicer-constructor.test.js')
-rw-r--r-- | fastify-busboy/test/dicer-constructor.test.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/fastify-busboy/test/dicer-constructor.test.js b/fastify-busboy/test/dicer-constructor.test.js new file mode 100644 index 0000000..e0e6a6c --- /dev/null +++ b/fastify-busboy/test/dicer-constructor.test.js @@ -0,0 +1,22 @@ +'use strict' + +const { test } = require('tap') +const Dicer = require('../deps/dicer/lib/Dicer') + +test('dicer-constructor', t => { + t.plan(2) + + t.test('should throw an Error when no options parameter is supplied to Dicer', t => { + t.plan(1) + + t.throws(() => new Dicer(), new Error('Boundary required')) + }) + + t.test('without new operator a new dicer instance will be initialized', t => { + t.plan(1) + + t.type(Dicer({ + boundary: '----boundary' + }), Dicer) + }) +}) |