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

294
Views
Js: tengo este error mientras intento construir una prueba de Cypress "FileField no es un constructor"

Tengo que intentar crear alguna composición de prueba usando js, estoy siguiendo este artículo: https://www.koderhq.com/tutorial/javascript/composition/#what-is

tengo una clase js

 class FileField { constructor () { } /** * Upload file to file field. * * @param {string} InputAttribute * @param {string} url * @param {string} AltAttribute */ uploadField(InputAttribute, url, AltAttribute ) {} } export default {FileField}

Y trato de usar esta clase de esta manera en otra clase:

 import { DefaultContent } from "./DefaultContent/DefaultContent"; import { PROPERTY } from "./DefaultContent/DefaultContent"; import { FileField } from "./DefaultContent/FileField"; export default class ArticlePage extends DefaultContent { constructor(FileField) { this.fileField = new FileField(); } fillImageField() { // Upload the file this.fileField.uploadFile( this.imageInput, "/node/add/article?element_parents=field_image/widget/0&ajax_form=1&_wrapper_format=drupal_ajax", this.imageAltDescription, ); } }

Me sale el error: > FileField is not a constructor

ingrese la descripción de la imagen aquí

He revisado artículos y preguntas de StackOverflow pero ninguno funciona con mi código.

Gracias.

about 4 years ago · Juan Pablo Isaza
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!