Я пытаюсь провести модульное тестирование API, который выполняет регистрацию пользователя.Но получая,
TypeError: "string" must be a string, Buffer, or ArrayBuffer
Это мой кодовый блок,
describe("User registration unit test", ()=>{
it("The users should be able to register with proper credentials", ()=>{
return chai.request(testServer)
.post("/api/auth/register")
.set("Content-Type", "application/x-www-form-url-encoded")
.send({
"name": "Jithin333",
"email": "jtihin324@gmail.com",
"password": "Jithin12!",
"role": "user"
}).then((res)=> {
expect(res).to.have.status(201);
done();
})
});
});