node/test/parallel/test-module-loading-deprecated.js
Antoine du Hamel 76a073b67e module: runtime deprecate invalid package.json main entries
PR-URL: https://github.com/nodejs/node/pull/37204
Fixes: https://github.com/nodejs/node/issues/26588
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-02-24 11:27:48 +01:00

11 lines
316 B
JavaScript

'use strict';
const common = require('../common');
const assert = require('assert');
common.expectWarning('DeprecationWarning', {
DEP0128: /^Invalid 'main' field in '.+main[/\\]package\.json' of 'doesnotexist\.js'\..+module author/
});
assert.strictEqual(require('../fixtures/packages/missing-main').ok, 'ok');