egg/test/asyncSupport.test.js
William.Tung 164092965b
test: remove useless "async" support check (#5203)
Our current nodejs version MUST BE >=14.20.0, no need to check whether
the current version satisfies the test env.
2023-06-07 16:11:05 +08:00

28 lines
682 B
JavaScript

'use strict';
const assert = require('assert');
const mm = require('egg-mock');
const utils = require('./utils');
describe('test/asyncSupport.test.js', () => {
afterEach(mm.restore);
let app;
before(async () => {
app = utils.app('apps/async-app');
await app.ready();
assert(app.beforeStartExectuted);
assert(app.scheduleExecuted);
});
after(async () => {
await app.close();
assert(app.beforeCloseExecuted);
});
it('middleware, controller and service should support async functions', async () => {
await app.httpRequest()
.get('/api')
.expect(200)
.expect([ 'service', 'controller', 'router', 'middleware' ]);
});
});