Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

544
Views
TypeScript Esperaba 1 argumentos, pero obtuvo 2

¿Qué tiene de malo mi función createUser()? ¿Por qué no puedo poner parámetros en Smoke.ts?

Iniciar sesión.ts:

 interface User { url: string, email: string, } class Test{ async createUser(user: User) { await Page.setUrl(user.url); await Page.setEmail(user.email); } }

Humo.ts

 test("Smoke Test", async (t) => { console.log("Starting test"); await Login.createUser( "google.com","joe" );

Aparece un error: se esperaban 1 argumentos, pero se obtuvieron 2.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

El método createUser espera un objeto con la siguiente forma: { url: string, email: string, }

Y está pasando una cadena como primer parámetro y otra cadena como segundo parámetro.

deberías estar pasando un objeto como este:

 createUser({ url: 'google.com', email: 'joe' })

Por cierto, ¿por qué estás usando "interfaz" y no "escribir" aquí? el tipo es más común para definir formas de objetos y la interfaz se usa a menudo para describir comportamientos

about 4 years ago · Juan Pablo Isaza Report

0

su función createUser se declaró con un solo parámetro, pero cuando llama a este método, pasó dos parámetros. para arreglar esto necesitas pasar el objeto de usuario

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!