From 63380cba990391b91e33fe38caee581f7ba0b710 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Sat, 30 Aug 2014 00:25:28 -0400 Subject: [PATCH] tests: add more tests --- test/test.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/test.js b/test/test.js index 38810f2..2fa345e 100644 --- a/test/test.js +++ b/test/test.js @@ -49,10 +49,12 @@ describe('etag(entity)', function () { describe('with "weak" option', function () { describe('when "false"', function () { it('should generate a strong ETag for a string', function () { + assert.equal(etag('', {weak: false}), '"1B2M2Y8AsgTpgAmY7PhCfg=="') assert.equal(etag('beep boop', {weak: false}), '"Z34SGyQ2IB7YzB7HMkCjrQ=="') }) it('should generate a strong ETag for a Buffer', function () { + assert.equal(etag(new Buffer(0), {weak: false}), '"1B2M2Y8AsgTpgAmY7PhCfg=="') assert.equal(etag(new Buffer([1, 2, 3]), {weak: false}), '"Uonfc331cyb83SJZevsfrA=="') }) @@ -63,10 +65,12 @@ describe('etag(entity)', function () { describe('when "true"', function () { it('should generate a weak ETag for a string', function () { + assert.equal(etag('', {weak: true}), 'W/"0-0"') assert.equal(etag('beep boop', {weak: true}), 'W/"9-7f3ee715"') }) it('should generate a weak ETag for a Buffer', function () { + assert.equal(etag(new Buffer(0), {weak: true}), 'W/"0-0"') assert.equal(etag(new Buffer([1, 2, 3]), {weak: true}), 'W/"3-55bc801d"') })