SHARE
TWEET

Untitled

a guest Aug 21st, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. it("Should get all addresses", async () => {
  2.      const address_1 = await Address.create({
  3.          street: VALID_STREET,
  4.          number: VALID_NUMBER,
  5.          city: VALID_CITY,
  6.          country: VALID_COUNTRY
  7.      });
  8.      const address_2 = await Address.create({
  9.          street: "street 2",
  10.          number: "2",
  11.          city: "City 2",
  12.          country: "Country 2"
  13.      });
  14.  
  15.      const allAddresses = await controller._getAll();
  16.      expect(allAddresses).toEqual(
  17.          expect.arrayContaining([address_1, address_2])
  18.      );
  19.  });
  20.      
  21. expect(received).toEqual(expected) // deep equality
  22.  
  23.     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}]
  24.     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}]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top