lundi 9 mars 2020

macho test can not see the associations between models, but with postman all works fine

I have written a feathers-sequelize backend ( with docker-compose). It works fine. Now I want to run this mocha test to it.

const assert = require("assert");
const app = require("../../app").app;
describe("users/users", () => {
it("creates a user", async () => {
const service = app.service("users/users");
const users = await service.create({
  name: "Tom",
  email: "myemail",
  is_admin: true
});
assert.ok(users, "Registered the service");
 });

But it gives this error: restaurants in not associated to users.

But I have associated such a table to the users and in postman I get all the infos and I can create a new user with restaurants.

I have googled it but no help. thanks.

Aucun commentaire:

Enregistrer un commentaire