summaryrefslogtreecommitdiffstats
path: root/test/esm-wrapper.js
blob: a593fbdb53159f3e22ce1d09b010e32fab5f80f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'use strict'
const { nodeMajor, nodeMinor } = require('../lib/core/util')

if (!((nodeMajor > 14 || (nodeMajor === 14 && nodeMajor > 13)) || (nodeMajor === 12 && nodeMinor > 20))) {
  require('tap') // shows skipped
} else {
  ;(async () => {
    try {
      await import('./utils/esm-wrapper.mjs')
    } catch (e) {
      if (e.message === 'Not supported') {
        require('tap') // shows skipped
        return
      }
      console.error(e.stack)
      process.exitCode = 1
    }
  })()
}