-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[#4461] Change typescript declaration for .writeFile() #4463
Conversation
@@ -2318,6 +2318,12 @@ declare namespace Cypress { | |||
cancelable: boolean | |||
} | |||
|
|||
/** Options to change the default behavior of .writeFile */ | |||
interface WriteFileOptions extends Loggable { | |||
flag: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flag is only string even in native node's fs
declarations
@@ -1776,13 +1776,13 @@ declare namespace Cypress { | |||
}) | |||
``` | |||
*/ | |||
writeFile<C extends FileContents>(filePath: string, contents: C, options?: Partial<Loggable>): Chainable<C> | |||
writeFile<C extends FileContents>(filePath: string, contents: C, encoding: Encodings): Chainable<C> | |||
/** | |||
* Write to a file with the specified encoding and contents. | |||
* | |||
* @see https://on.cypress.io/writefile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add an example here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we also need a tiny example / test in the types test in the CLI folder cli/types/tests
@dmtrKovalenko how is your text editor set up - leaves trailing whitespace
|
@bahmutov I am using prettier + eslint. Tslint is deprecated https://medium.com/palantir/tslint-in-2019-1a144c2317a9 |
@dmtrKovalenko we use |
Yeah, I know but it is deprecated way |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great now
Closes #4461
Changing typescript definition signature for
.writeFile
method according to the docs.