UNPKG

518 BJavaScriptView Raw
1'use strict'
2
3const t = require('tap')
4const semver = require('semver')
5
6if (semver.lt(process.versions.node, '13.3.0')) {
7 t.skip('Skip because Node version <= 13.3.0')
8 t.end()
9} else {
10 // Node v8 throw a `SyntaxError: Unexpected token import`
11 // even if this branch is never touch in the code,
12 // by using `eval` we can avoid this issue.
13 // eslint-disable-next-line
14 new Function('module', 'return import(module)')('./esm.mjs').catch((err) => {
15 process.nextTick(() => {
16 throw err
17 })
18 })
19}