mirror of
https://github.com/nodejs/node.git
synced 2025-04-30 23:56:58 +00:00

The test fixture in test/fixtures/bluebird was largely copied from bluebird, where a regression in Node.js was discovered. Simplify the test by removing a lot of things that aren't necessary to replicate the problem. Change name from bluebird to something less likely to cause someone to believe that we are actually loading bluebird (as we are not). PR-URL: https://github.com/nodejs/node/pull/31435 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: David Carlier <devnexen@gmail.com>
22 lines
657 B
JavaScript
22 lines
657 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
|
|
// Test that a nonexistent "main" entry in a package.json that also omits an
|
|
// "exports" entry will be ignored if it can be found in node_modules instead
|
|
// rather than throwing.
|
|
//
|
|
// Throwing is perhaps "correct" behavior, but it will break bluebird tests
|
|
// as of this writing.
|
|
|
|
const assert = require('assert');
|
|
const { spawnSync } = require('child_process');
|
|
const fixtures = require('../common/fixtures');
|
|
|
|
const testFile = fixtures.path('package-main-enoent', 'test.js');
|
|
|
|
const { error, status, stderr } = spawnSync(process.execPath, [testFile]);
|
|
|
|
assert.ifError(error);
|
|
assert.strictEqual(status, 0, stderr);
|