Skip to content

Commit

Permalink
fix: only run the esm importing test on node >= 12
Browse files Browse the repository at this point in the history
.

.
  • Loading branch information
niieani committed Aug 17, 2019
1 parent 3c70024 commit e9aebcf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests-mjs/importing.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
// this will only parse and run if you're using node >= 10 with the --experimental-modules flag
// this will only parse and run if you're using node >= 12 with the --experimental-modules flag
// alternatively, if you use something like webpack
// that's why it is in a separate file

import childProcess from 'child_process'

describe('importing', () => {
const supportsEsm = /^v\d[2-9]/.test(process.version)
const describeIfEsm = supportsEsm ? describe : describe.skip

// only run on node >= v12:
describeIfEsm('importing', () => {
test('loads via .mjs', async () => {
expect.assertions(1)
const p = childProcess.spawn(
Expand Down

0 comments on commit e9aebcf

Please sign in to comment.