it("should not add duplicates to existing media types in stack", function () { const api = createRestApi() api.Properties = ["image/jpeg"] const p = createPlugin(api) p.serverless.service.custom = { apiGateway: { binaryMediaTypes: ["image/jpeg"], }, } const hook = getHook(p) hook() expect(api.Properties.BinaryMediaTypes).to.deep.equal(["image/jpeg"]) })
it("should not overwrite any existing media types in stack", function () { const api = createRestApi() api.Properties.BinaryMediaTypes = ["image/jpeg"] const p = createPlugin(api) p.serverless.service.custom = { apiGateway: { binaryMediaTypes: ["image/png"], }, } const hook = getHook(p) hook() expect(api.Properties.BinaryMediaTypes).to.deep.equal([ "image/jpeg", "image/png", ]) })
expect(api.Properties.BinaryMediaTypes).to.deep.equal([ "image/png", "image/jpeg",