Skip to content
Discussion options

You must be logged in to vote

So the cy.env() command implementation does take options: packages/driver/src/cy/commands/env.ts has env (envVars, userOptions: EnvOptions = {}) and reads options.log / options.timeout, and the docs list cy.env(keys, options). The problem is cli/types/cypress.d.ts only ships env(keys: string[]) overloads, so tsc gives you Expected 1 arguments, but got 2 even though the call is fine at runtime.

I reproduced it on 15.18.1: cy.env(["v"], { log: false }) fails typecheck. A small local augment clears it while the runtime still honors { log: false }:

declare namespace Cypress {
  interface Chainable {
    env(keys: string[], options: Partial<Cypress.Loggable & Cypress.Timeoutable>): Chainable<R…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by kuzjka
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants