From 0ca80446c49adb2b61b1022ff1d8045f237bbc6f Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 12 Dec 2019 10:44:28 -0500 Subject: [PATCH] test: make test-os-checked-function work without test harness Most tests in `test/parallel` work when invoked with `node` rather than `tools/test.py` but not test-os-checked-function because it doesn't load the `common` module initially, which means it won't get re-spawned with the necessary flags (in the Flags: comment, in this case --expose_internals). Now that common delays loading 'os' until it needs to load it, this test can load the common module and it will work from the command line without the test harness. Additionally, we now can remove a comment disabling a lint rule. PR-URL: https://github.com/nodejs/node/pull/30914 Reviewed-By: Ruben Bridgewater Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau --- test/parallel/test-os-checked-function.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/parallel/test-os-checked-function.js b/test/parallel/test-os-checked-function.js index 44337adb4063ae..4a6c1cd0cafb09 100644 --- a/test/parallel/test-os-checked-function.js +++ b/test/parallel/test-os-checked-function.js @@ -1,7 +1,7 @@ -/* eslint-disable node-core/require-common-first */ 'use strict'; // Flags: --expose_internals +const common = require('../common'); const { internalBinding } = require('internal/test/binding'); // Monkey patch the os binding before requiring any other modules, including @@ -12,7 +12,6 @@ internalBinding('os').getHomeDirectory = function(ctx) { ctx.message = 'baz'; }; -const common = require('../common'); const os = require('os'); common.expectsError(os.homedir, {