it('invokeFunction with invalid event should fail', async function () { expect(() => { client.invokeFunction(serviceName, functionName, { event: 'hello world', }); }).to.throwException(/"event" must be String or Buffer/); });
it('message property invalid, value contains \'', function() { var msgProps = new MessageProperties(); expect(() => { msgProps.putProperty("abc", "123'"); }).to.throwException(); });
it('Bone.attribute(name, meta) sets column meta, should not be public', async function() { Post.attribute('extra', { type: String }); expect(Post.attributes.extra.jsType).to.eql(String); Post.attribute('extra', { type: JSON }); expect(() => Post.attribute('missing', { type: JSON })).to.throwException(); });
it('should reject a truthy options argument that is not an object', function() { expect(function() { plugin('foo'); }).to.throwException(function(e) { expect(e).to.be.a(SanityError); expect(e.message).to.equal('Truthy options argument passed to plugin must be an object.'); }); });
it('constructor', function () { expect(() => { new MQClient(); }).to.throwException(/"endpoint" must be passed in/); expect(() => { new MQClient('endpoint'); }).to.throwException(/must pass in "accessKeyId"/); expect(() => { new MQClient('endpoint', 'accessKeyId'); }).to.throwException(/must pass in "accessKeySecret"/); });
it('error when include empty parameter', function () { expect(function () { new XTemplate("{{include(a)}}").render(); }).to.throwException(/include command required a non-empty parameter/); });
it("should reject floating specifier", function() { expect(function() { return SQL`SELECT * FROM ?: WHERE FALSE`; }).to.throwException(/Unsupported floating modifier/); });
it('message property invalid, value contains "', function() { var msgProps = new MessageProperties(); expect(() => { msgProps.putProperty("abc", "123\""); }).to.throwException(); });
it('message property invalid, key contains \"', function() { var msgProps = new MessageProperties(); expect(() => { msgProps.putProperty("abc\"", "123"); }).to.throwException(); });
it('error when include without parameter', function () { expect(function () { new XTemplate("{{include()}}").render(); }).to.throwException(/include\/parse\/extend can only has at most two parameter!/); });
it('error when include more than one parameter', function () { expect(function () { new XTemplate("{{include(a, b,c)}}").render(); }).to.throwException(/include\/parse\/extend can only has at most two parameter!/); });
it('message property invalid, key contains \'', function() { var msgProps = new MessageProperties(); expect(() => { msgProps.putProperty("abc\'", "123"); }).to.throwException(); });
it('message property invalid, key contains <', function() { var msgProps = new MessageProperties(); expect(() => { msgProps.putProperty("abc<", "123"); }).to.throwException(); });
it('message property invalid, value contains <', function() { var msgProps = new MessageProperties(); expect(() => { msgProps.putProperty("abc", "123<"); }).to.throwException(); });
it('should reject a value that is not a boolean', function() { expect(function() { plugin({ defaultOmitNew: 'true' }); }).to.throwException(function(e) { expect(e).to.be.a(SanityError); expect(e.message).to.equal('defaultOmitNew passed as plugin option must be a boolean.'); }); });