handler.test.ts
This file
Path
src/adapter/aws-lambda/handler.test.ts
15 lines · 724 bytes · TypeScript
Last changed by
fix(lambda): don't encode text (#1091)Yusuke Wadabefore adoption821a408
History of this fileTake it
fix(lambda): don't encode text (#1091)Yusuke Wadabefore adoption821a408
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})