mirror of
https://github.com/abrendan/MicDropMessages.git
synced 2025-08-27 15:02:03 +02:00
Initial commit
This commit is contained in:
16
node_modules/server/plugins/security/unit.test.js
generated
vendored
Normal file
16
node_modules/server/plugins/security/unit.test.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
const run = require('server/test/run');
|
||||
const { get, post } = require('server/router');
|
||||
|
||||
describe('static plugin', () => {
|
||||
it('csurf', async () => {
|
||||
return await run({ public: 'test' }, [
|
||||
get('/', ctx => ctx.res.locals.csrf),
|
||||
post('/', () => '世界')
|
||||
]).alive(async api => {
|
||||
const csrf = (await api.get('/')).body;
|
||||
expect(csrf).toBeDefined();
|
||||
const res = await api.post('/', { body: { _csrf: csrf }});
|
||||
expect(res.statusCode).toBe(200);
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user