Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- it("Should get all addresses", async () => {
- const address_1 = await Address.create({
- street: VALID_STREET,
- number: VALID_NUMBER,
- city: VALID_CITY,
- country: VALID_COUNTRY
- });
- const address_2 = await Address.create({
- street: "street 2",
- number: "2",
- city: "City 2",
- country: "Country 2"
- });
- const allAddresses = await controller._getAll();
- expect(allAddresses).toEqual(
- expect.arrayContaining([address_1, address_2])
- );
- });
- expect(received).toEqual(expected) // deep equality
- Expected: ArrayContaining [{"city": "A city", "country": "Belgium", "createdAt": 2019-08-21T14:05:23.063Z, "fullAddress": "valid street 123 A, A city, Belgium", "id": 296, "number": "123 A", "postalCode": null, "street": "valid street", "updatedAt": 2019-08-21T14:05:23.063Z}, {"city": "City 2", "country": "Country 2", "createdAt": 2019-08-21T14:05:23.066Z, "fullAddress": "street 2 2, City 2, Country 2", "id": 297, "number": "2", "postalCode": null, "street": "street 2", "updatedAt": 2019-08-21T14:05:23.066Z}]
- Received: [{"city": "A city", "country": "Belgium", "createdAt": 2019-08-21T14:05:23.063Z, "fullAddress": "valid street 123 A, A city, Belgium", "id": 296, "number": "123 A", "postalCode": null, "street": "valid street", "updatedAt": 2019-08-21T14:05:23.063Z}, {"city": "City 2", "country": "Country 2", "createdAt": 2019-08-21T14:05:23.066Z, "fullAddress": "street 2 2, City 2, Country 2", "id": 297, "number": "2", "postalCode": null, "street": "street 2", "updatedAt": 2019-08-21T14:05:23.066Z}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement