From 4a2e62ffd8bd18fac67e385781758ff3baff983d Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Thu, 1 Jul 2021 14:24:47 -0500 Subject: [PATCH] Update test --- test/integration/image-optimizer/test/index.test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/integration/image-optimizer/test/index.test.js b/test/integration/image-optimizer/test/index.test.js index 886674ce8177f..07eca10b961bb 100644 --- a/test/integration/image-optimizer/test/index.test.js +++ b/test/integration/image-optimizer/test/index.test.js @@ -98,6 +98,8 @@ function runTests({ w, isDev, domains }) { expect(res.headers.get('Cache-Control')).toBe( `public, max-age=${isDev ? 0 : 60}, must-revalidate` ) + // SVG is compressible so will have accept-encoding set from + // compression expect(res.headers.get('Vary')).toMatch(/^Accept(,|$)/) expect(res.headers.get('etag')).toBeTruthy() const actual = await res.text() @@ -504,7 +506,9 @@ function runTests({ w, isDev, domains }) { expect(res.headers.get('Cache-Control')).toBe( `public, max-age=${isDev ? 0 : 60}, must-revalidate` ) - expect(res.headers.get('Vary')).toBe('Accept') + // bmp is compressible so will have accept-encoding set from + // compression + expect(res.headers.get('Vary')).toMatch(/^Accept(,|$)/) expect(res.headers.get('etag')).toBeTruthy() const json2 = await fsToJson(imagesDir)