Skip to content

Commit 855bc5f

Browse files
committed
feat: add a test to check the response of the example endpoint
1 parent d8fc793 commit 855bc5f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/example.test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const request = require('supertest');
2+
const { setupStrapi, stopStrapi } = require('../playground/tests/helpers');
3+
4+
let strapi;
5+
6+
beforeAll(async () => {
7+
strapi = await setupStrapi();
8+
});
9+
10+
afterAll(async () => {
11+
await stopStrapi();
12+
});
13+
14+
it('should return a successful response from the example endpoint', async () => {
15+
const response = await request(strapi.server.httpServer)
16+
.get('/api/boilerplate')
17+
.expect(200);
18+
19+
expect(response.text).toBe('Welcome to Strapi 🚀');
20+
});

0 commit comments

Comments
 (0)