download
raw
803 Bytes
'use strict'
const { test } = require('tap')
const { validatePlugin } = require('../../lib/validate-plugin')
const { AVV_ERR_PLUGIN_NOT_VALID } = require('../../lib/errors')
test('validatePlugin', (t) => {
t.plan(8)
t.throws(() => validatePlugin(1), new AVV_ERR_PLUGIN_NOT_VALID('number'))
t.throws(() => validatePlugin('function'), new AVV_ERR_PLUGIN_NOT_VALID('string'))
t.throws(() => validatePlugin({}), new AVV_ERR_PLUGIN_NOT_VALID('object'))
t.throws(() => validatePlugin([]), new AVV_ERR_PLUGIN_NOT_VALID('array'))
t.throws(() => validatePlugin(null), new AVV_ERR_PLUGIN_NOT_VALID('null'))
t.doesNotThrow(() => validatePlugin(function () {}))
t.doesNotThrow(() => validatePlugin(new Promise((resolve) => resolve)))
t.doesNotThrow(() => validatePlugin(Promise.resolve()))
})

Xet Storage Details

Size:
803 Bytes
·
Xet hash:
ed639f5cbf4e6a37a13db4e52b24604a33291d14f3ad7969d482d0e06aa0f261

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.