Skip to content

Commit 63380cb

Browse files
committed
tests: add more tests
1 parent 9b0b3f2 commit 63380cb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ describe('etag(entity)', function () {
4949
describe('with "weak" option', function () {
5050
describe('when "false"', function () {
5151
it('should generate a strong ETag for a string', function () {
52+
assert.equal(etag('', {weak: false}), '"1B2M2Y8AsgTpgAmY7PhCfg=="')
5253
assert.equal(etag('beep boop', {weak: false}), '"Z34SGyQ2IB7YzB7HMkCjrQ=="')
5354
})
5455

5556
it('should generate a strong ETag for a Buffer', function () {
57+
assert.equal(etag(new Buffer(0), {weak: false}), '"1B2M2Y8AsgTpgAmY7PhCfg=="')
5658
assert.equal(etag(new Buffer([1, 2, 3]), {weak: false}), '"Uonfc331cyb83SJZevsfrA=="')
5759
})
5860

@@ -63,10 +65,12 @@ describe('etag(entity)', function () {
6365

6466
describe('when "true"', function () {
6567
it('should generate a weak ETag for a string', function () {
68+
assert.equal(etag('', {weak: true}), 'W/"0-0"')
6669
assert.equal(etag('beep boop', {weak: true}), 'W/"9-7f3ee715"')
6770
})
6871

6972
it('should generate a weak ETag for a Buffer', function () {
73+
assert.equal(etag(new Buffer(0), {weak: true}), 'W/"0-0"')
7074
assert.equal(etag(new Buffer([1, 2, 3]), {weak: true}), 'W/"3-55bc801d"')
7175
})
7276

0 commit comments

Comments
 (0)