handler.test.ts
This file
Path
src/adapter/lambda-edge/handler.test.ts
15 lines · 724 bytes · TypeScript
Last changed by
feat(adapter): AWS Lambda Adapter supports requests via Lambda@edge (#1210)watanybefore adoptionedca699
History of this fileTake it
feat(adapter): AWS Lambda Adapter supports requests via Lambda@edge (#1210)watanybefore adoptionedca699
lines 1–15why, one step back1import { isContentTypeBinary } from './handler'23describe('isContentTypeBinary', () => {4 it('Should determine whether it is binary', () => {5 expect(isContentTypeBinary('image/png')).toBe(true)6 expect(isContentTypeBinary('font/woff2')).toBe(true)7 expect(isContentTypeBinary('text/plain')).toBe(false)8 expect(isContentTypeBinary('text/plain; charset=UTF-8')).toBe(false)9 expect(isContentTypeBinary('text/css')).toBe(false)10 expect(isContentTypeBinary('text/javascript')).toBe(false)11 expect(isContentTypeBinary('application/json')).toBe(false)12 expect(isContentTypeBinary('application/ld+json')).toBe(false)13 expect(isContentTypeBinary('application/json; charset=UTF-8')).toBe(false)14 })15})