Created
November 7, 2021 13:58
-
-
Save reke592/d4ffc15966c8c56e9c04f718a2d20264 to your computer and use it in GitHub Desktop.
Revisions
-
reke592 created this gist
Nov 7, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ const request = require('supertest'); const { app } = require('../server'); describe('Form input options', () => { it('GET /option/regions --> array public list regions', () => { return request(app) .get('/option/regions') .expect('Content-Type', /json/) .expect(200) .then(response => { return expect(response.body).toEqual(expect.arrayContaining([ expect.objectContaining({ name: expect.any(String) }) ])) }); }); it('GET /option/genders --> 200 array public list genders', () => { return request(app) .get('/option/genders') .expect('Content-Type', /json/) .expect(200) .then(response => { return expect(response.body).toEqual(expect.arrayContaining([ expect.objectContaining({ id: expect.any(Number), name: expect.any(String) }) ])) }); }); });