Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

336
Vistas
TypeError: Suite argument "title" must be a string. Received type "undefined"

I am trying to save data to MongoDB, But this error is occurring.

I am trying to export the describe function to save data on MongoDB onclick on Complete button. Also, why is it var app is not showing on my page when I include const demo = require on my index.js. I think I need it to import the describe function. I don't know what's wrong, please send help.

This is my index.js

const demo = require("./demo_test")

Survey
    .StylesManager
    .applyTheme("defaultV2");

const json = {
    pages: [
      {
        questions: [
          {
            type: "radiogroup",
            name: "Question 1",
            title: "Deliver through others.",
            choices: [
              "Not effective",
              "Neither effective nor Effective",
              "Effective"
            ]
          },
          {
            type: "radiogroup",
            name: "Question 2",
            title: "Understand others perspective.",
            choices: [
              "Not effective",
              "Neither effective nor Effective",
              "Effective"
            ]
          },
          {
            type: "radiogroup",
            name: "Question 3",
            title: "Solve complex problems.",
            choices: [
              "Not effective", 
              "Neither effective nor Effective",
              "Effective"
            ]
          },
        ]
      }
    ]
  };

window.survey = new Survey.Model(json);

survey
    .onComplete
    .add(function (sender) {
        let data = JSON.stringify(sender.data)
        data = data.replaceAll("Not effective", "A")
        data = data.replaceAll("Neither effective nor Effective", "B")
        data = data.replaceAll("Effective", "C")
    var obj = JSON.parse(data)

    document
        .querySelector('#surveyResult')
        .textContent = "Result JSON:\n" + JSON.stringify(obj, null, 3);
        
    describe(obj)

});

var app = new Vue({
    el: '#surveyElement',
    data: {
        survey: survey
    }
});

this is my demo_test.js

const mocha = require('mocha')
const { assert } = require('assert');
const Question = require('../models/questions');


describe('Saving records', function(obj){

it('Saves a record to the database', function(done){
    var char = new Question({
        obj
    });

    char.save().then(function(){
        assert(char.isNew === false);
        done();
    });
});
});

    module.exports = describe();
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda