{"size": 1148, "ext": "js", "max_stars_repo_path": "__tests__/server.test.js", "max_stars_repo_name": "Laith-Hayajneh/basic-express-server", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "__tests__/server.test.js", "max_issues_repo_name": "Laith-Hayajneh/basic-express-server", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "__tests__/server.test.js", "max_forks_repo_name": "Laith-Hayajneh/basic-express-server", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 24.4255319149, "max_line_length": 80, "alphanum_fraction": 0.5522648084}
'user strict';
const {describe} = require('@jest/globals');

const { server } = require('../src/server');
const supertest = require('supertest');
const request = supertest(server);

describe('middleware server', () => {
    it('Should check the 404 not found error', async () => {
        // arrange
        let status = 404;
        let param = '/error';
        // act
        const response = await request.get(param);
        // assert
        expect(response.status).toBe(status);
    });



    it('Should check the 500 Internal Server Error', async () => {
        // arrange
        let status = 500;
        let param = '/bad';
        // act
        const response = await request.get(param);
        // assert
        expect(response.status).toBe(status);
    });




    it('Should check the Every Thing Is Working Good Successfully', async() => {
        //arrange
         let status=200;
         let param='/';
         let text='working fine';
         // act
         const response =await request.get(param);
         //assert
         expect(response.status).toBe(status);
         expect(response.text).toBe(text)


    });
});