CRICDatabase / searchable-image-database-nodejs

Backend in Node.js for CRIC Searchable Image Database
GNU Affero General Public License v3.0
1 stars 5 forks source link

Improve test suit structure #123

Closed rgaiacs closed 4 years ago

rgaiacs commented 4 years ago

@costascaio please note that I re-structure the test suit. It is organise now as

describe(
    "GET /route/to/test",
    () => {
        test(
            "anonymous",
            () => {
                return request(app)
                    .get("/route/to/test")
                    .then(
                        response => {
                            expect(response.statusCode).toBe(200);
                        }
                    );
            }
        );

        test(
            "charles",
            () => {
                return request(app)
                    .get("/route/to/test")
                    .then(
                        response => {
                            expect(response.statusCode).toBe(200);
                        }
                    );
            }
        );

        test(
            "admin",
            () => {
                return request(app)
                    .get("/route/to/test")
                    .then(
                        response => {
                            expect(response.statusCode).toBe(200);
                        }
                    );
            }
        );

    }
);