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

334
Views
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
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!