summaryrefslogtreecommitdiff
path: root/mocha_test/asyncFunctions.js
blob: 3b759e1c8209896dd9abd7037979d267b0a7bcee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var isAsync = require('../lib/internal/wrapAsync').isAsync;

function supportsAsync() {
    var supported;
    try {
        /* eslint no-eval: 0 */
        supported = isAsync(eval('(async function () {})'));
    } catch (e) {
        supported = false;
    }
    return supported;
}

describe('async function support', function () {
    this.timeout(100);

    if (supportsAsync()) {
        require('./es2017/asyncFunctions.js')();
    } else {
        it('should not test async functions in this environment');
    }
});