• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3require('../common');
4
5// Test that a nonexistent "main" entry in a package.json that also omits an
6// "exports" entry will be ignored if it can be found in node_modules instead
7// rather than throwing.
8//
9// Throwing is perhaps "correct" behavior, but it will break bluebird tests
10// as of this writing.
11
12const assert = require('assert');
13const { spawnSync } = require('child_process');
14const fixtures = require('../common/fixtures');
15
16const testFile = fixtures.path('package-main-enoent', 'test.js');
17
18const { error, status, stderr } = spawnSync(process.execPath, [testFile]);
19
20assert.ifError(error);
21assert.strictEqual(status, 0, stderr);
22