mirror of
https://github.com/strapi/strapi.git
synced 2025-11-13 00:29:51 +00:00
22 lines
471 B
JavaScript
22 lines
471 B
JavaScript
|
|
'use strict';
|
||
|
|
|
||
|
|
const request = require('supertest');
|
||
|
|
|
||
|
|
const Koa = require('../..').server;
|
||
|
|
|
||
|
|
describe('.experimental=true', function () {
|
||
|
|
it('should support async functions', function (done) {
|
||
|
|
const app = new Koa();
|
||
|
|
app.experimental = true;
|
||
|
|
app.use(async function () {
|
||
|
|
const string = await Promise.resolve('asdf');
|
||
|
|
this.body = string;
|
||
|
|
});
|
||
|
|
|
||
|
|
request(app.callback())
|
||
|
|
.get('/')
|
||
|
|
.expect('asdf')
|
||
|
|
.expect(200, done);
|
||
|
|
});
|
||
|
|
});
|