Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cy.writeFile() is working with JS specs, but not with TypeScript specs #4461

Closed
Kondasamy opened this issue Jun 14, 2019 · 3 comments
Closed

cy.writeFile() is working with JS specs, but not with TypeScript specs #4461

Kondasamy opened this issue Jun 14, 2019 · 3 comments

Comments

@Kondasamy
Copy link

@Kondasamy Kondasamy commented Jun 14, 2019

This is in reference to the issue - #4456

Current behavior:

cy.writeFile("../output/oozie_workflows.csv", oozieId + ",False", {
  encoding: 'utf-8'
  flag: "a"
});

The above code works fine with JavaScript specs, but with TypeScript specs - it throws below error message.

Argument of type '{ encoding: string; flag: string; }' is not assignable to parameter of type 'Encodings'.
  Type '{ encoding: string; flag: string; }' is not assignable to type '"utf-16le"'.ts(2345)

I'm sure this something to do with the file: index.d.ts. Please check.

Versions

Cypress - 3.3.1

@jennifer-shehane
Copy link
Member

@jennifer-shehane jennifer-shehane commented Jun 14, 2019

Oh, yes, this definitely looks like a Typing issue. Thanks for following up.

cy.writeFile() should allow the following signatures as per https://on.cypress.io/writefile#Syntax

Screen Shot 2019-06-14 at 12 40 05 PM

Definition can be found here: https://github.com/cypress-io/cypress/blob/develop/cli/types/index.d.ts#L1779

@jennifer-shehane
Copy link
Member

@jennifer-shehane jennifer-shehane commented Jun 18, 2019

The code for this is done in #4463, but this has yet to be released. We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link

@cypress-bot cypress-bot bot commented Jun 27, 2019

Released in 3.3.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants