pact-foundation / pact-provider-verifier

Cross-platform, generic language, Pact provider verification tool
http://pact.io
MIT License
32 stars 24 forks source link

Array min is not working at provider verification #30

Closed Dolly2315 closed 5 years ago

Dolly2315 commented 5 years ago

At consumer level test is :

describe('Listing taxonomies', () => {
        before(() => {
            return provider.addInteraction({
                given: 'GET call for taxonomies',
                uponReceiving: 'Get object for listing taxonomies',
                withRequest: {
                    method: 'GET',
                    path: '/api/taxonomies',
                },
                willRespondWith: {
                    status: 200,
                    body: eachLike([{
                            'id': like(8061159),
                            'name': like('Country'),
                            'displayName': like('Country'),
                            'description': like(''),
                            'enabled': like(true),
                            'accountId': like(4),
                            'visibilityIds': eachLike([
                                4
                            ]),
                            'userId': like(5),
                            'created': like('31 Jan 2018 11:56:48 +00:00'),
                            'lastModified': like('01 Feb 2018 11:58:49 +00:00')
                        }
                    ])
                }
            });
        });

When i verify at provider level , I am getting the error as:

1) Verifying a pact between flex-search-app and flex-taxonomy-service Get object for listing taxonomies with GET /api/taxonomies returns a response which has a matching body
     Failure/Error: expect(response_body).to match_term expected_response_body, diff_options, example

       Actual: [{"id":21150851,"name":"112076","displayName":"112076","description":"","enabled":true,"accountId":10265,"visibilityIds":[10265],"userId":10267,"created":"03 May 2018 08:36:28 +00:00","lastModified":"03 May 2018 08:36:28 +00:00"},{"id":15053699,"name":"address","displayName":"Address","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"10 Jul 2018 11:04:50 +00:00","lastModified":"10 Jul 2018 11:04:50 +00:00"},{"id":15053796,"name":"asdf","displayName":"asdf","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"10 Jul 2018 11:21:20 +00:00","lastModified":"10 Jul 2018 11:21:20 +00:00"},{"id":21289908,"name":"category","displayName":"category","description":"","enabled":false,"accountId":64553,"visibilityIds":[64553],"userId":64555,"created":"11 May 2018 06:26:30 +00:00","lastModified":"04 Jul 2018 10:07:20 +00:00"},{"id":10055650,"name":"cbc","displayName":"CBC","description":"","enabled":true,"accountId":4,"visibilityIds":[4,10240],"userId":5,"created":"07 Feb 2018 15:53:40 +00:00","lastModified":"07 Feb 2018 16:04:49 +00:00"},{"id":122731247,"name":"cmpoc-texonomy","displayName":"cmpoc-texonomy","description":"","enabled":true,"accountId":228499,"visibilityIds":[228499],"userId":229075,"created":"21 Nov 2018 13:12:59 +00:00","lastModified":"21 Nov 2018 13:12:59 +00:00","displayInApps":false},{"id":21135413,"name":"country","displayName":"Country","description":"","enabled":true,"accountId":10137,"visibilityIds":[10137],"userId":10223,"created":"02 May 2018 11:33:37 +00:00","lastModified":"02 May 2018 11:33:38 +00:00"},{"id":15053701,"name":"country1","displayName":"Country1","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"10 Jul 2018 11:05:18 +00:00","lastModified":"10 Jul 2018 11:05:18 +00:00"},{"id":10070027,"name":"deepali","displayName":"DeepaliRename456","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"08 Feb 2018 11:34:11 +00:00","lastModified":"09 Feb 2018 06:08:34 +00:00"},{"id":8061159,"name":"demo-taxonomy","displayName":"Demo Taxonomy","description":"","enabled":true,"accountId":4,"visibilityIds":[4,10329,10323,10240,17575],"userId":5,"created":"31 Jan 2018 11:56:48 +00:00","lastModified":"01 Feb 2018 11:58:49 +00:00"},{"id":8078165,"name":"demo-tt","displayName":"Demo tt","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"01 Feb 2018 11:03:59 +00:00","lastModified":"01 Feb 2018 11:03:59 +00:00"},{"id":21242047,"name":"epam-test-taxonomy","displayName":"epam-test-taxonomy","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"08 May 2018 12:40:57 +00:00","lastModified":"08 May 2018 12:40:57 +00:00"},{"id":122731056,"name":"flag22","displayName":"flag22","description":"flag22","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"20 Nov 2018 12:08:39 +00:00","lastModified":"20 Nov 2018 12:21:35 +00:00","displayInApps":true},{"id":122731058,"name":"flag222","displayName":"flag222","description":"flag222","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"20 Nov 2018 12:09:04 +00:00","lastModified":"20 Nov 2018 12:10:49 +00:00","displayInApps":false},{"id":146832,"name":"flex-24945","displayName":"FLEX-24945","description":"","enabled":true,"accountId":10265,"visibilityIds":[10265],"userId":10267,"created":"27 Feb 2018 09:01:46 +00:00","lastModified":"27 Feb 2018 09:01:46 +00:00"},{"id":15068814,"name":"flex-24953-taxonomy","displayName":"FLEX-24953-Taxonomy","description":"","enabled":true,"accountId":4,"visibilityIds":[4,10329,10240],"userId":5,"created":"13 Mar 2018 06:48:05 +00:00","lastModified":"13 Mar 2018 06:48:05 +00:00"},{"id":272685,"name":"flex-25048","displayName":"FLEX-25048","description":"","enabled":true,"accountId":10265,"visibilityIds":[10265],"userId":10267,"created":"06 Mar 2018 14:26:49 +00:00","lastModified":"06 Mar 2018 14:26:49 +00:00"},{"id":63637,"name":"flex-50649","displayName":"FLEX-50649","description":"","enabled":true,"accountId":10265,"visibilityIds":[10265],"userId":10267,"created":"15 Jun 2018 11:10:30 +00:00","lastModified":"15 Jun 2018 11:10:30 +00:00"},{"id":15053072,"name":"greengrocery","displayName":"food","description":"","enabled":true,"accountId":64553,"visibilityIds":[64553],"userId":64555,"created":"04 Jul 2018 09:50:38 +00:00","lastModified":"25 Sep 2018 08:22:50 +00:00"},{"id":22214801,"name":"football","displayName":"Football","description":"","enabled":true,"accountId":66473,"visibilityIds":[66473],"userId":67886,"created":"23 Mar 2018 11:11:12 +00:00","lastModified":"23 Mar 2018 11:11:12 +00:00"},{"id":15056267,"name":"fusa","displayName":"fusa","description":"","enabled":true,"accountId":10265,"visibilityIds":[10265],"userId":10267,"created":"27 Jul 2018 13:51:50 +00:00","lastModified":"27 Jul 2018 13:51:50 +00:00"},{"id":13040168,"name":"fwfwf","displayName":"fwfwf","description":"fww","enabled":true,"accountId":126376,"visibilityIds":[126376],"userId":126378,"created":"18 Jun 2018 07:03:19 +00:00","lastModified":"18 Jun 2018 07:03:19 +00:00"},{"id":115574,"name":"geo","displayName":"Geo","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"25 Feb 2018 13:59:40 +00:00","lastModified":"25 Feb 2018 13:59:40 +00:00"},{"id":15054142,"name":"hari","displayName":"Hari","description":"","enabled":true,"accountId":7,"visibilityIds":[5],"userId":6,"created":"11 Jul 2018 08:27:23 +00:00","lastModified":"11 Jul 2018 08:27:23 +00:00"},{"id":15053910,"name":"hari-demo","displayName":"Hari-Demo","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"10 Jul 2018 12:24:20 +00:00","lastModified":"10 Jul 2018 12:24:20 +00:00"},{"id":31102138,"name":"hari1","displayName":"Hari1","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"14 Sep 2018 10:11:49 +00:00","lastModified":"14 Sep 2018 10:11:49 +00:00"},{"id":8160944,"name":"ipl","displayName":"IPL","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"06 Feb 2018 04:38:02 +00:00","lastModified":"06 Feb 2018 05:08:09 +00:00"},{"id":5050182,"name":"lee","displayName":"Lee","description":"","enabled":true,"accountId":10240,"visibilityIds":[10240],"userId":10243,"created":"26 Jan 2018 12:31:38 +00:00","lastModified":"26 Jan 2018 12:31:38 +00:00"},{"id":15053475,"name":"mobile-taxonomy","displayName":"Mobile Taxonomy","description":"Mobile Taxonomy","enabled":true,"accountId":4,"visibilityIds":[4,10329,66473,10240],"userId":5,"created":"09 Jul 2018 09:20:19 +00:00","lastModified":"09 Jul 2018 09:20:19 +00:00"},{"id":8081937,"name":"organization","displayName":"Organization","description":"","enabled":true,"accountId":10240,"visibilityIds":[10240],"userId":10243,"created":"01 Feb 2018 16:15:18 +00:00","lastModified":"01 Feb 2018 16:15:18 +00:00"},{"id":15054160,"name":"prasad","displayName":"Prasad","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"11 Jul 2018 09:05:39 +00:00","lastModified":"11 Jul 2018 09:05:39 +00:00"},{"id":31102172,"name":"prasad900","displayName":"Prasad900","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"14 Sep 2018 11:01:31 +00:00","lastModified":"14 Sep 2018 11:01:31 +00:00"},{"id":22174104,"name":"publish-taxon","displayName":"publish-taxon","description":"","enabled":true,"accountId":10131,"visibilityIds":[10131],"userId":10216,"created":"21 Mar 2018 05:48:16 +00:00","lastModified":"21 Mar 2018 05:48:16 +00:00"},{"id":10152644,"name":"random","displayName":"random1234","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"13 Feb 2018 05:29:09 +00:00","lastModified":"13 Feb 2018 05:29:34 +00:00"},{"id":22214835,"name":"regio
n","displayName":"Region","description":"","enabled":true,"accountId":66473,"visibilityIds":[66473],"userId":67886,"created":"23 Mar 2018 11:13:17 +00:00","lastModified":"23 Mar 2018 11:13:17 +00:00"},{"id":10069995,"name":"test1234","displayName":"renametaxonomy123999","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"08 Feb 2018 11:31:41 +00:00","lastModified":"13 Feb 2018 05:25:02 +00:00"},{"id":5028771,"name":"sample","displayName":"sample","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"25 Jan 2018 07:02:40 +00:00","lastModified":"25 Jan 2018 07:02:40 +00:00"},{"id":122731046,"name":"sasas","displayName":"sasas","description":"sasas","enabled":true,"accountId":1,"visibilityIds":[1],"userId":1,"created":"20 Nov 2018 11:54:01 +00:00","lastModified":"20 Nov 2018 11:54:01 +00:00","displayInApps":false},{"id":122731044,"name":"sas","displayName":"sasas1","description":"sasas","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"20 Nov 2018 11:47:10 +00:00","lastModified":"20 Nov 2018 11:56:47 +00:00","displayInApps":false},{"id":15053401,"name":"school","displayName":"School","description":"","enabled":true,"accountId":10240,"visibilityIds":[10240],"userId":10243,"created":"06 Jul 2018 13:00:57 +00:00","lastModified":"06 Jul 2018 13:00:57 +00:00"},{"id":15053772,"name":"some-display-naaaaaame","displayName":"some display naaaaaame","description":"some-description","enabled":true,"accountId":3,"visibilityIds":[3],"userId":3,"created":"10 Jul 2018 11:19:54 +00:00","lastModified":"10 Jul 2018 11:19:54 +00:00"},{"id":15053762,"name":"some-display-naaaame","displayName":"some display naaaame","description":"some-description","enabled":true,"accountId":1,"visibilityIds":[1],"userId":3,"created":"10 Jul 2018 11:18:27 +00:00","lastModified":"10 Jul 2018 11:18:27 +00:00"},{"id":8040076,"name":"somerandom","displayName":"somerandom11232","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"30 Jan 2018 07:06:12 +00:00","lastModified":"08 Feb 2018 11:35:54 +00:00"},{"id":14042639,"name":"sport","displayName":"Sport","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"14 Feb 2018 16:15:02 +00:00","lastModified":"14 Feb 2018 16:15:02 +00:00"},{"id":5015758,"name":"taxon-1","displayName":"Taxon 1","description":"","enabled":true,"accountId":4,"visibilityIds":[10329],"userId":5,"created":"24 Jan 2018 13:21:32 +00:00","lastModified":"02 Feb 2018 05:52:11 +00:00"},{"id":5015768,"name":"taxon-2","displayName":"Taxon 2","description":"","enabled":true,"accountId":4,"visibilityIds":[4,10113],"userId":5,"created":"24 Jan 2018 13:22:08 +00:00","lastModified":"24 Jan 2018 13:22:08 +00:00"},{"id":22618,"name":"taxonomies1","displayName":"Taxonomies1","description":"Taxonomies1","enabled":true,"accountId":134740,"visibilityIds":[134740],"userId":134742,"created":"13 Jun 2018 05:38:19 +00:00","lastModified":"13 Jun 2018 05:38:19 +00:00"},{"id":8083240,"name":"taxonomy","displayName":"taxonomy","description":"","enabled":false,"accountId":10240,"visibilityIds":[10240],"userId":10243,"created":"01 Feb 2018 17:57:11 +00:00","lastModified":"08 Mar 2018 07:22:57 +00:00"},{"id":304956,"name":"taxonomy-1","displayName":"Taxonomy 1","description":"","enabled":true,"accountId":10240,"visibilityIds":[10240],"userId":10243,"created":"08 Mar 2018 10:44:09 +00:00","lastModified":"21 Mar 2018 05:49:27 +00:00"},{"id":8149292,"name":"taxonomy-test-1","displayName":"Taxonomy Test 1","description":"","enabled":true,"accountId":10265,"visibilityIds":[10265],"userId":10267,"created":"05 Feb 2018 12:35:56 +00:00","lastModified":"05 Feb 2018 12:35:56 +00:00"},{"id":15058151,"name":"taxonomy_accountb","displayName":"taxonomy_AccountB","description":"","enabled":true,"accountId":10329,"visibilityIds":[10329],"userId":10249,"created":"10 Aug 2018 12:29:55 +00:00","lastModified":"10 Aug 2018 12:29:55 +00:00"},{"id":10040546,"name":"taxonomy-test","displayName":"taxonomy-test","description":"","enabled":true,"accountId":10329,"visibilityIds":[10329],"userId":10249,"created":"06 Feb 2018 19:12:49 +00:00","lastModified":"06 Feb 2018 19:12:49 +00:00"},{"id":60216478,"name":"taxonomy1699432843","displayName":"Taxonomy1699432843","description":"","enabled":true,"accountId":10122,"visibilityIds":[10122],"userId":10214,"created":"05 Nov 2018 09:32:10 +00:00","lastModified":"05 Nov 2018 09:32:10 +00:00"},{"id":65240190,"name":"taxonomy5190548010","displayName":"Taxonomy5190548010","description":"","enabled":true,"accountId":10122,"visibilityIds":[10122],"userId":10214,"created":"06 Nov 2018 08:55:55 +00:00","lastModified":"06 Nov 2018 08:55:55 +00:00"},{"id":8092406,"name":"taxonomybugtest","displayName":"TaxonomyBugTest","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"02 Feb 2018 06:28:45 +00:00","lastModified":"02 Feb 2018 06:28:45 +00:00"},{"id":22440,"name":"taxonomys","displayName":"Taxonomys","description":"Taxonomys","enabled":true,"accountId":134740,"visibilityIds":[134740],"userId":134742,"created":"13 Jun 2018 05:24:48 +00:00","lastModified":"13 Jun 2018 05:24:48 +00:00"},{"id":305215,"name":"test-event","displayName":"test-event","description":"","enabled":true,"accountId":10240,"visibilityIds":[10240],"userId":10243,"created":"08 Mar 2018 11:03:10 +00:00","lastModified":"08 Mar 2018 11:03:10 +00:00"},{"id":8060213,"name":"test12","displayName":"test12","description":"test","enabled":true,"accountId":10240,"visibilityIds":[10240],"userId":10243,"created":"31 Jan 2018 10:39:43 +00:00","lastModified":"31 Jan 2018 10:39:43 +00:00"},{"id":8144186,"name":"test123","displayName":"test123","description":"","enabled":true,"accountId":10240,"visibilityIds":[10240],"userId":10243,"created":"05 Feb 2018 05:46:56 +00:00","lastModified":"05 Feb 2018 05:46:56 +00:00"},{"id":22075026,"name":"test12345543453451","displayName":"Test12345543453451","description":"Deepali Demo","enabled":true,"accountId":10240,"visibilityIds":[10240],"userId":10243,"created":"15 Mar 2018 14:27:30 +00:00","lastModified":"15 Mar 2018 14:27:30 +00:00"},{"id":8072575,"name":"test2","displayName":"Test2","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"01 Feb 2018 03:41:13 +00:00","lastModified":"01 Feb 2018 03:41:13 +00:00"},{"id":8074990,"name":"testdue","displayName":"testdue","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"01 Feb 2018 06:48:24 +00:00","lastModified":"01 Feb 2018 06:48:24 +00:00"},{"id":10152803,"name":"testing1","displayName":"testing123","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"13 Feb 2018 05:42:04 +00:00","lastModified":"13 Feb 2018 05:43:36 +00:00"},{"id":10083747,"name":"testing45","displayName":"testing45asdfasdda","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"09 Feb 2018 06:24:27 +00:00","lastModified":"09 Feb 2018 06:24:57 +00:00"},{"id":304809,"name":"testtaxo","displayName":"testtaxo","description":"","enabled":true,"accountId":10122,"visibilityIds":[10122],"userId":10214,"created":"08 Mar 2018 10:32:23 +00:00","lastModified":"08 Mar 2018 10:32:23 +00:00"},{"id":8091978,"name":"testts","displayName":"testts","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"02 Feb 2018 05:53:29 +00:00","lastModified":"02 Feb 2018 05:53:29 +00:00"},{"id":15053790,"name":"testtt-some-display-naaaaaame","displayName":"TESTTT  some display naaaaaame","description":"some-description","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"10 Jul 2018 11:20:56 +00:00","lastModified":"10 Jul 2018 11:20:56 +00:00"},{"id":5010450,"name":"test","displayName":"testupasana","description":"","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"24 Jan 2018 06:04:07 +00:00","lastModified":"13 Feb 2018 05:28:33 +00:00"},{"id":15057930,"name":"tx1","displayName":"TX1","description":"","enabled":true,"accountId":10125,"visibilityIds":[10125],"userId":64558,"created":"10 Aug 2018 04:28:42 +00:00
","lastModified":"10 Aug 2018 04:28:42 +00:00"},{"id":122731048,"name":"vinodsample","displayName":"vinodsample","description":"vinodsample","enabled":true,"accountId":1,"visibilityIds":[1],"userId":1,"created":"20 Nov 2018 12:03:54 +00:00","lastModified":"20 Nov 2018 12:03:54 +00:00","displayInApps":true},{"id":122731050,"name":"vinodsample2","displayName":"vinodsample2","description":"vinodsample2","enabled":true,"accountId":1,"visibilityIds":[1],"userId":1,"created":"20 Nov 2018 12:05:48 +00:00","lastModified":"20 Nov 2018 12:05:48 +00:00","displayInApps":false},{"id":122731052,"name":"vinodsample21","displayName":"vinodsample21","description":"vinodsample21","enabled":true,"accountId":1,"visibilityIds":[4],"userId":5,"created":"20 Nov 2018 12:07:01 +00:00","lastModified":"20 Nov 2018 12:07:01 +00:00","displayInApps":false},{"id":122731054,"name":"vinodsampled21","displayName":"vinodsampled21","description":"vinodsampled21","enabled":true,"accountId":4,"visibilityIds":[4],"userId":5,"created":"20 Nov 2018 12:08:00 +00:00","lastModified":"20 Nov 2018 12:08:00 +00:00","displayInApps":false},{"id":31103217,"name":"visibility-sub","displayName":"visibility-sub","description":"","enabled":true,"accountId":99231,"visibilityIds":[99231],"userId":99238,"created":"20 Sep 2018 09:40:28 +00:00","lastModified":"20 Sep 2018 09:40:28 +00:00"},{"id":21239001,"name":"zoomin-taxonomy","displayName":"Zoomin Taxonomy","description":"","enabled":true,"accountId":10125,"visibilityIds":[10125],"userId":10205,"created":"08 May 2018 08:33:54 +00:00","lastModified":"08 May 2018 08:33:54 +00:00"}]

       Diff
       --------------------------------------
       Key: - is expected 
            + is actual 
       Matching keys and values are not shown

        [
       -  [
       -    {
       -      "id": 8061159,
       -      "name": "Country",
       -      "displayName": "Country",
       -      "description": "",
       -      "enabled": true,
       -      "accountId": 4,
       -      "visibilityIds": [
       -        [
       -          4,
       -        ],
       -      ],
       -      "userId": 5,
       -      "created": "31 Jan 2018 11:56:48 +00:00",
       -      "lastModified": "01 Feb 2018 11:58:49 +00:00"
       -    },
       -  ],
       -  [
       -    {
       -      "id": 8061159,
       -      "name": "Country",
       -      "displayName": "Country",
       -      "description": "",
       -      "enabled": true,
       -      "accountId": 4,
       -      "visibilityIds": [
       -        [
       -          4,
       -        ],
       -      ],
       -      "userId": 5,
       -      "created": "31 Jan 2018 11:56:48 +00:00",
       -      "lastModified": "01 Feb 2018 11:58:49 +00:00"
       -    },
       -  ],
       -  [
       -    {
       -      "id": 8061159,
       -      "name": "Country",
       -      "displayName": "Country",
       -      "description": "",
       -      "enabled": true,
       -      "accountId": 4,
       -      "visibilityIds": [
       -        [
       -          4,
       -        ],
       -      ],
       -      "userId": 5,
       -      "created": "31 Jan 2018 11:56:48 +00:00",
       -      "lastModified": "01 Feb 2018 11:58:49 +00:00"
       -    },
       -  ],
       -  [
       -    {
       -      "id": 8061159,
       -      "name": "Country",
       -      "displayName": "Country",
       -      "description": "",
       -      "enabled": true,
       -      "accountId": 4,
       -      "visibilityIds": [
       -        [
       -          4,
       -        ],
       -      ],
       -      "userId": 5,

So it is again and again verifying the same one data of consumer ie id": 8061159 with the huge set of provider data .But in "$.body": { "min": 1 },

min array is already defined though

mefellows commented 5 years ago

The problem is your matcher is incorrect:

Change this:

body: eachLike([{
                            'id': like(8061159),
                            'name': like('Country'),
                            'displayName': like('Country'),
                            'description': like(''),
                            'enabled': like(true),
                            'accountId': like(4),
                            'visibilityIds': eachLike([
                                4
                            ]),
                            'userId': like(5),
                            'created': like('31 Jan 2018 11:56:48 +00:00'),
                            'lastModified': like('01 Feb 2018 11:58:49 +00:00')
                        }
                    ])

to (note removed [ and ])

body: eachLike({
                            'id': like(8061159),
                            'name': like('Country'),
                            'displayName': like('Country'),
                            'description': like(''),
                            'enabled': like(true),
                            'accountId': like(4),
                            'visibilityIds': eachLike([
                                4
                            ]),
                            'userId': like(5),
                            'created': like('31 Jan 2018 11:56:48 +00:00'),
                            'lastModified': like('01 Feb 2018 11:58:49 +00:00')
                        })

Also, you can avoid the like statements within an eachLike as it is implied by default. If you need to use a different matcher (e.g. a term then go for it). So you can actually do this:

body: eachLike({
                  'id':8061159,
                  'name':'Country',
                  'displayName':'Country',
                  'description':'',
                  'enabled':true,
                  'accountId':4,
                  'visibilityIds': eachLike(4),
                  'userId':5,
                  'created':'31 Jan 2018 11:56:48 +00:00',
                  'lastModified':'01 Feb 2018 11:58:49 +00:00'
              })
Dolly2315 commented 5 years ago

Thanks