Skip to content

Commit f5f7a62

Browse files
authored
Merge pull request #37 from clowder-cloud/CL-141-Endpoints-documentation-out-of-date
CL-141-Endpoints-documentation-out-of-date
2 parents 283d757 + 90ce00d commit f5f7a62

2 files changed

Lines changed: 365 additions & 132 deletions

File tree

__tests__/app.test.ts

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,17 @@ afterAll(() => {
1818
});
1919

2020
describe('🧪 Express Application', () => {
21-
describe('Root', () => {
22-
describe('GET /api', () => {
23-
it('200: should return a successful response', () => {
24-
return request(app)
25-
.get('/api')
26-
.expect(200)
27-
.then(({ body }) => {
28-
expect(body).toEqual({
29-
success: true,
30-
});
21+
describe('GET /api', () => {
22+
it('200: should return a successful response', () => {
23+
return request(app)
24+
.get('/api')
25+
.expect(200)
26+
.then(({ body }) => {
27+
expect(body).toEqual({
28+
success: true,
29+
data: expect.any(Object),
3130
});
32-
});
33-
});
34-
35-
describe('GET /api/endpoints', () => {
36-
const expectedData = {};
37-
endpointsJson.forEach((endpoint) => {
38-
const copy = JSON.parse(JSON.stringify(endpoint));
39-
delete copy.path;
40-
Object.assign(expectedData, {
41-
[endpoint.path]: {
42-
...copy,
43-
},
4431
});
45-
});
46-
it('200: should return a successful response', () => {
47-
return request(app)
48-
.get('/api/endpoints')
49-
.expect(200)
50-
.then(({ body: { success, data } }) => {
51-
expect(success).toBe(true);
52-
expect(data).toEqual(expectedData);
53-
});
54-
});
5532
});
5633
});
5734

0 commit comments

Comments
 (0)