From d37d2cb011c2b3b420204a298428040c20e207d4 Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Wed, 24 Aug 2016 12:20:07 +0100 Subject: [PATCH] test: add edge case test to filtering --- test/unit/filters.test.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/unit/filters.test.js b/test/unit/filters.test.js index ab8c98c79..fc2a55e62 100644 --- a/test/unit/filters.test.js +++ b/test/unit/filters.test.js @@ -4,7 +4,7 @@ const Filters = require('../../lib/filters'); tap('filter on body', t => { const filter = Filters(__dirname + '/../fixtures/relay.json'); - t.plan(7); + t.plan(8); t.ok('filters loaded'); filter({ @@ -58,4 +58,14 @@ tap('filter on body', t => { t.equal(res, undefined, 'no follow allowed'); }); + filter({ + url: '/', + method: 'POST', + body: { + commits: [] + } + }, (error, res) => { + t.equal(error.message, 'blocked', 'has been blocked'); + }); + });