diff options
Diffstat (limited to 'mocha_test/asyncFunctions.js')
-rw-r--r-- | mocha_test/asyncFunctions.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mocha_test/asyncFunctions.js b/mocha_test/asyncFunctions.js new file mode 100644 index 0000000..67e1b16 --- /dev/null +++ b/mocha_test/asyncFunctions.js @@ -0,0 +1,20 @@ +describe('async function support', function () { + this.timeout(100); + + var supportsAsync; + var supportsSymbol = typeof Symbol !== 'undefined'; + try { + /* eslint no-eval:0 */ + var fn = eval('(async function() {})') + supportsAsync = supportsSymbol && + fn[Symbol.toStringTag] === 'AsyncFunction'; + } catch (e) { + supportsAsync = false; + } + + if (supportsAsync) { + require('./es2017/asyncFunctions.js')(); + } else { + it('should not test async functions in this environment'); + } +}); |