mirror of
https://github.com/strapi/strapi.git
synced 2025-11-10 07:10:11 +00:00
22 lines
471 B
JavaScript
Executable File
22 lines
471 B
JavaScript
Executable File
'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);
|
|
});
|
|
});
|