Error: Forbidden testing strapi
const request = require("supertest")
const { grantPrivilege } = require("./../helpers/strapi");
beforeAll(async () => {
await grantPrivilege(2, "permissions.application.controllers.hello.index"); // Gives Public access to endpoint
});
it('should return hello world', async (done) => {
await request(strapi.server) // app server is an instance of Class: http.Server
.get('/hello')
.expect(200) // Expect response http code 200
.then((data) => {
expect(data.text).toBe('Hello World!') // expect the response text
})
done()
})
Are there any code examples left?
New code examples in category ActionScript
-
ActionScript 2022-03-27 21:30:39 rabbitmq docker can access website
-
ActionScript 2022-01-26 23:16:45 truncate restart identity - syntax error at or near "identity"
-
ActionScript 2022-01-22 21:00:37 hide or remove link on print
-
ActionScript 2021-11-21 09:28:07 bootstrap
-
ActionScript 2021-11-19 13:38:17 iis appcmd stop site
-
ActionScript 2021-11-18 14:26:06 yaml reference library variable
-
ActionScript 2021-11-17 07:40:14 save docker image from local repo
-
ActionScript 2021-11-14 04:23:13 for of with index
-
ActionScript 2021-11-09 21:28:20 bootstrap 5 examples