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

109
Views
Getting 'Uncaught TypeError: Cannot read properties of undefined (reading 'should')'

I'm getting 'Uncaught TypeError: Cannot read properties of undefined (reading 'should')' when running the following. Why is that?

const {
  expect
} = require('chai');
const chai = require('chai');
const chaiHTTP = require('chai-http');
const should = chai.should()

chai.use(chaiHTTP);
//tester om man kan oprette annonce med rigtigt UserId
const endPoint = 'http://localhost:1000/lavAnnonce'

describe(`POST new user ${endPoint}`, () => {
  it(`should post a new Annonce`, (done) => {
    const payload = {
      title: 'DALDSADW',
      price: 50,
      location: 'hovedstaden',
      category: 'sko',
      colour: 'sort',
      billede: 'findes ikke',
      user_id: '180'
    };
    chai
      .request(endPoint)
      .post("")
      .set("content-type", "application/json")
      .send(payload)
      .end((err, response) => {
        response.should.have.status(200)
        done();
      });
  });
});
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!