Skip to content

Commit

Permalink
fixup!: lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
himself65 committed Sep 20, 2023
1 parent 8082847 commit 1addfa1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
4 changes: 2 additions & 2 deletions lib/internal/modules/esm/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ function legacyMainResolve(packageJSONUrl, packageConfig, base) {

if (typeof packageConfig.main !== 'string') {
throw new ERR_INVALID_PACKAGE_CONFIG(
fileURLToPath(packageJSONUrl), base,
'"main" must be a string', 'main');
fileURLToPath(packageJSONUrl), base,
'"main" must be a string', 'main');
}

const resolvedOption = FSLegacyMainResolve(packageJsonUrlString, packageConfig.main, baseStringified);
Expand Down
35 changes: 17 additions & 18 deletions test/es-module/test-import-empty.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
'use strict';

const {spawnPromisified} = require('../common');
const { spawnPromisified } = require('../common');
const fixtures = require('../common/fixtures.js');
const assert = require('node:assert');
const path = require('node:path');
const {execPath} = require('node:process');
const {describe, it} = require('node:test');
const { execPath } = require('node:process');
const { describe, it } = require('node:test');

describe('Import empty module', {concurrency: true}, () => {
it(async () => {
const {code, signal, stdout, stderr} = await spawnPromisified(execPath, [
'--no-warnings',
'--eval',
'import("empty")',
], {
cwd: fixtures.path(),
});
assert.strictEqual(code, 1);
assert.strictEqual(signal, null);
assert.strictEqual(stdout, '');
assert.match(stderr, /Error \[ERR_INVALID_PACKAGE_CONFIG]: Invalid package config/);
describe('Import empty module', { concurrency: true }, () => {
it(async () => {
const { code, signal, stdout, stderr } = await spawnPromisified(execPath, [
'--no-warnings',
'--eval',
'import("empty")',
], {
cwd: fixtures.path(),
});
})
assert.strictEqual(code, 1);
assert.strictEqual(signal, null);
assert.strictEqual(stdout, '');
assert.match(stderr, /Error \[ERR_INVALID_PACKAGE_CONFIG]: Invalid package config/);
});
});

0 comments on commit 1addfa1

Please sign in to comment.