Skip to content

Enable cy.route to set a fixtures encoding #374

@brian-mann

Description

@brian-mann

Currenly when you use the fx:path_to_fixture or fixture:path_to_fixture we automatically set encoding to utf8.

It would be ideal to be able to control the encoding.

Since we are kind of conflating the cy.fixture encoding signature, we'll just go with a pathToFile,[encoding] signature.

cy.route({
  url: "image.png",
  response: "fx:path/to/file,binary" //<--- pass ,binary to signify binary encoding
  headers: {
    "content-type": "binary/octet-stream" // <-- TODO, we should automatically be setting these content-type headers when the encoding is manually specified
  }
})

Metadata

Metadata

Assignees

Labels

type: enhancementRequested enhancement of existing feature

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions