• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2require('../common');
3const fixtures = require('../common/fixtures');
4const assert = require('assert');
5const { spawnSync } = require('child_process');
6const fixture = fixtures.path('/es-modules/import-invalid-ext.mjs');
7const child = spawnSync(process.execPath, [fixture]);
8const errMsg = 'TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension';
9
10assert.strictEqual(child.status, 1);
11assert.strictEqual(child.signal, null);
12assert.strictEqual(child.stdout.toString().trim(), '');
13assert.ok(child.stderr.toString().includes(errMsg));
14