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

74
Views
value are not set by the calling function in mocha framework

i have written random function to set some string values in accountname and this is in utilities/random.js. when I try calling this function in my test/sample.js this function is not setting the value of account name

random function

export const randomString = (n) => {
    let str = 'abcdefghijklmnopqrstuvwxyz9876543210';
    let tmp = '',
        i = 0,
        l = str.length;
    for (i = 0; i < n; i++){
        tmp += str.charAt(Math.floor(Math.random() * l));
    }
    return tmp;
}

calling it in test/sample.js

import { randomNum, randomString } from '../utils/random';     
let accountname = randomString(length);

enter image description here

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!