]) t.throws(() => fs.accessSync(dirname), 'directory is removed')
]) t.throws(() => fs.accessSync(dirname), 'directory is removed')
test('ringpop without options throws', function t(assert) { assert.throws(function throwIt() { Ringpop(); }, /Expected `options` argument to be passed/); assert.end(); });
['someString', {someObject: 'someValue'}, ['foo', 'bar'], null, undefined].forEach(function (input) { test('It only accepts numbers (not ' + typeof input + ') as input', function (t) { t.plan(1); t.throws(function () { secondsToTime(input); }); }); });
test('it must not accept indexes that are not non-negative integers', t => { t.plan(3); const expectedException = TypeError; const expectedMessage = 'index must be a non-negative integer'; t.throws(() => generator('a')(-1), expectedException, expectedMessage); t.throws(() => generator('a')([]), expectedException, expectedMessage); t.throws(() => generator('b')({}), expectedException, expectedMessage); });
tap.test('api > blows up on type without flags or aliases', t => { t.throws(() => { Api.get().custom(new Type()) }) t.end() })
test('removeMetaProperty throws if property is not found', async (t) => { const logger = new Logger(apiKey) t.throws(() => { logger.removeMetaProperty('NOPE') }, { message: 'There is no meta property called NOPE' }, 'Expected error was thrown') })
test.test('WSS connection must connect and inspect', test => { test.plan(1); test.throws( () => jstp.wss.connect(app.name, null, null, '__illegal__url__'), 'connect must throw an error' ); });
test.test( 'must throw an error on invalid version in application name', test => { test.throws( () => { new jstp.Application('app@__invalid__', interfacesV1); }, TypeError, 'Invalid semver version' ); test.end(); } );
test('_flush expects a callback', async (t) => { const logger = new Logger(apiKey) t.throws(() => { logger._flush('NOPE') }, { message: 'flush function expects a callback' }, 'Expected error was thrown') })
test.test('WebSocket connection must connect and inspect', test => { test.plan(1); test.throws( () => jstp.ws.connect(app.name, null, null, '__illegal__url__'), 'connect must throw an error' ); });
test('ringpop without options throws', function t(assert) { assert.throws(function throwIt() { Ringpop(); }, /Expected `options` argument to be passed/); assert.end(); });
test('it must not accept non-string values as alphabet', t => { t.plan(3); const expectedException = TypeError; const expectedMessage = 'alphabet must be a string'; t.throws(() => generator(-1), expectedException, expectedMessage); t.throws(() => generator([]), expectedException, expectedMessage); t.throws(() => generator({}), expectedException, expectedMessage); });
(0, _tap.test)('it must not accept non-string values as alphabet', function (t) { t.plan(3); var expectedException = TypeError; var expectedMessage = 'alphabet must be a string'; t.throws(function () { return (0, _index.generator)(-1); }, expectedException, expectedMessage); t.throws(function () { return (0, _index.generator)([]); }, expectedException, expectedMessage); t.throws(function () { return (0, _index.generator)({}); }, expectedException, expectedMessage); });
(0, _tap.test)('it must not accept indexes that are not non-negative integers', function (t) { t.plan(3); var expectedException = TypeError; var expectedMessage = 'index must be a non-negative integer'; t.throws(function () { return (0, _index.generator)('a')(-1); }, expectedException, expectedMessage); t.throws(function () { return (0, _index.generator)('a')([]); }, expectedException, expectedMessage); t.throws(function () { return (0, _index.generator)('b')({}); }, expectedException, expectedMessage); });