From 1ae076b30ea9eaef128939666ddcd222afea42b7 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 7 May 2018 06:04:07 +0200 Subject: [PATCH] test: add loaded modules test This makes sure there is no regression by switching to loading eagerly. PR-URL: https://github.com/nodejs/node/pull/20567 Reviewed-By: Gus Caplan Reviewed-By: Matteo Collina Reviewed-By: James M Snell Reviewed-By: Jeremiah Senkpiel --- test/parallel/test-bootstrap-modules.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/parallel/test-bootstrap-modules.js diff --git a/test/parallel/test-bootstrap-modules.js b/test/parallel/test-bootstrap-modules.js new file mode 100644 index 00000000000000..4a46ac905b8161 --- /dev/null +++ b/test/parallel/test-bootstrap-modules.js @@ -0,0 +1,14 @@ +/* eslint-disable node-core/required-modules */ + +'use strict'; + +// Ordinarily test files must require('common') but that action causes +// the global console to be compiled, defeating the purpose of this test. +// This makes sure no additional files are added without carefully considering +// lazy loading. Please adjust the value if necessary. + +const list = process.moduleLoadList.slice(); + +const assert = require('assert'); + +assert(list.length <= 73, list);