Commit 49ad95045a0 for nodejs
commit 49ad95045a0c10931b2c94995dee0b9f0e231379
Author: Matteo Collina <hello@matteocollina.com>
Date: Thu Oct 15 09:53:03 2026 +0200
vfs: unflag
Enable node:vfs by default. --no-experimental-vfs disables node:vfs
exposure and --vfs-load.
Assisted-by: pi
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: https://github.com/nodejs/node/pull/66318
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
diff --git a/doc/api/cli.md b/doc/api/cli.md
index c6caa4a6b57..56b08cece38 100644
--- a/doc/api/cli.md
+++ b/doc/api/cli.md
@@ -330,7 +330,7 @@ so mounting one is gated on its own flag rather than on `--allow-fs-read` or
`--allow-fs-write`.
```console
-$ node --experimental-vfs --permission --allow-fs-vfs app.js
+$ node --permission --allow-fs-vfs app.js
```
### `--allow-fs-write`
@@ -1711,16 +1711,6 @@ with AND, so a test must satisfy every expression to run.
A malformed expression causes the test runner to exit with a non-zero status
before running any tests.
-### `--experimental-vfs`
-
-<!-- YAML
-added: v26.4.0
--->
-
-> Stability: 1 - Experimental
-
-Enable the experimental [`node:vfs`][] module.
-
### `--experimental-vm-modules`
<!-- YAML
@@ -2364,6 +2354,18 @@ changes:
Disable the experimental [`node:sqlite`][] module.
+### `--no-experimental-vfs`
+
+<!-- YAML
+added: v26.4.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/66318
+ description: VFS is unflagged but still experimental.
+-->
+
+Disable the experimental [`node:vfs`][] module and `--vfs-load`.
+
### `--no-experimental-webstorage`
<!-- YAML
@@ -3907,11 +3909,13 @@ added: v26.10.0
* `source` {string} A directory or an archive file to mount and run.
-Requires [`--experimental-vfs`][]. May be given at most once.
+May be given at most once.
Mounts `source` as a virtual file system ([`node:vfs`][]), and runs the entry
point and all subsequent `require()`/`import` resolution against that mount
-rather than the real file system. The mount is placed at a reserved mount point
+rather than the real file system. This option is unavailable when
+`--no-experimental-vfs` disables [`node:vfs`][]. The mount is placed at a
+reserved mount point
assigned by Node.js, so it never shadows real paths and no target can be
chosen. The entry point is taken from the mount the same way `node <directory>`
takes one: the mount's own `package.json` `"main"`, or `index.js`. Any
@@ -3942,18 +3946,17 @@ same thing in all of them.
A worker created with its own `execArgv` inherits none of the parent's options,
and so does not mount the source at all. To run a script from the mount, such a
-worker must be given the same options again, `--experimental-vfs` and
-`--vfs-load`; without them, that thread has no mount for the script to come
-from, and the worker fails to load it. `--experimental-vfs` is also what makes
-[`node:vfs`][] available to the worker's own code. A worker whose script comes
-from anywhere else, such as the real file system, needs nothing added.
+worker must be given `--vfs-load` again; without it, that thread has no mount
+for the script to come from, and the worker fails to load it. [`node:vfs`][] is
+available to worker code without an experimental flag. A worker whose script
+comes from anywhere else, such as the real file system, needs nothing added.
`--vfs-load` is not permitted in [`NODE_OPTIONS`][]: which entry point runs is
the command line's decision, and the environment must not be able to redirect
it.
```console
-$ node --experimental-vfs --vfs-load=app.zip
+$ node --vfs-load=app.zip
```
### `--watch`
@@ -4280,7 +4283,6 @@ one is included in the list below.
* `--experimental-stream-iter`
* `--experimental-test-isolation`
* `--experimental-top-level-await`
-* `--experimental-vfs`
* `--experimental-vm-modules`
* `--experimental-wasi-unstable-preview1`
* `--experimental-web-worker`
@@ -4315,6 +4317,7 @@ one is included in the list below.
* `--no-experimental-global-navigator`
* `--no-experimental-sqlite`
* `--no-experimental-strip-types`
+* `--no-experimental-vfs`
* `--no-experimental-webstorage`
* `--no-extra-info-on-fatal-exception`
* `--no-force-async-hooks-checks`
@@ -4914,7 +4917,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
[`--env-file-if-exists`]: #--env-file-if-existsfile
[`--env-file`]: #--env-filefile
[`--experimental-sea-config`]: single-executable-applications.md#1-generating-single-executable-preparation-blobs
-[`--experimental-vfs`]: #--experimental-vfs
[`--heap-prof-dir`]: #--heap-prof-dir
[`--import`]: #--importmodule
[`--no-require-module`]: #--no-require-module
diff --git a/doc/api/vfs.md b/doc/api/vfs.md
index 7113def065a..8bc4357c3b9 100644
--- a/doc/api/vfs.md
+++ b/doc/api/vfs.md
@@ -24,8 +24,8 @@ import vfs from 'node:vfs';
const vfs = require('node:vfs');
```
-This module is only available under the `node:` scheme, and only when Node.js
-is started with the `--experimental-vfs` flag.
+This module is only available under the `node:` scheme. Loading it emits an
+`ExperimentalWarning`.
## Security
@@ -77,8 +77,9 @@ added: v26.4.0
* `provider` {VirtualProvider} The provider to use. **Default:**
`new MemoryProvider()`.
* `options` {Object}
- * `emitExperimentalWarning` {boolean} Whether to emit the experimental
- warning when the instance is created. **Default:** `true`.
+ * `emitExperimentalWarning` {boolean} Whether to emit an experimental warning
+ when an instance is created. **Default:** `true`. Loading `node:vfs` emits
+ the warning regardless of this option.
* Returns: {VirtualFileSystem}
Convenience factory equivalent to `new VirtualFileSystem(provider, options)`.
@@ -148,7 +149,7 @@ vfs.registerProvider({
```
```console
-$ node --experimental-vfs --require ./provider.js \
+$ node --require ./provider.js \
--vfs-load archive.customfmt
```
@@ -193,8 +194,9 @@ added: v26.4.0
* `provider` {VirtualProvider} The provider to use. **Default:**
`new MemoryProvider()`.
* `options` {Object}
- * `emitExperimentalWarning` {boolean} Whether to emit the experimental
- warning. **Default:** `true`.
+ * `emitExperimentalWarning` {boolean} Whether to emit an experimental warning
+ when an instance is created. **Default:** `true`. Loading `node:vfs` emits
+ the warning regardless of this option.
### `vfs.mount()`
diff --git a/doc/node.1 b/doc/node.1
index d7da9e120a9..66b59b03608 100644
--- a/doc/node.1
+++ b/doc/node.1
@@ -210,7 +210,7 @@ A mounted VFS serves paths that the file system permissions do not describe,
so mounting one is gated on its own flag rather than on \fB--allow-fs-read\fR or
\fB--allow-fs-write\fR.
.Bd -literal
-$ node --experimental-vfs --permission --allow-fs-vfs app.js
+$ node --permission --allow-fs-vfs app.js
.Ed
.
.It Fl -allow-fs-write
@@ -930,9 +930,6 @@ with AND, so a test must satisfy every expression to run.
A malformed expression causes the test runner to exit with a non-zero status
before running any tests.
.
-.It Fl -experimental-vfs
-Enable the experimental \fBnode:vfs\fR module.
-.
.It Fl -experimental-vm-modules
Enable experimental ES Module support in the \fBnode:vm\fR module.
.
@@ -1233,6 +1230,9 @@ Legacy alias for \fB--no-require-module\fR.
.It Fl -no-experimental-sqlite
Disable the experimental \fBnode:sqlite\fR module.
.
+.It Fl -no-experimental-vfs
+Disable the experimental \fBnode:vfs\fR module and \fB--vfs-load\fR.
+.
.It Fl -no-experimental-webstorage
Disable \fBWeb Storage\fR support.
.
@@ -1973,10 +1973,12 @@ Print node's version.
.It
\fBsource\fR \fB{string}\fR A directory or an archive file to mount and run.
.El
-Requires \fB--experimental-vfs\fR. May be given at most once.
+May be given at most once.
Mounts \fBsource\fR as a virtual file system (\fBnode:vfs\fR), and runs the entry
point and all subsequent \fBrequire()\fR/\fBimport\fR resolution against that mount
-rather than the real file system. The mount is placed at a reserved mount point
+rather than the real file system. This option is unavailable when
+\fB--no-experimental-vfs\fR disables \fBnode:vfs\fR. The mount is placed at a
+reserved mount point
assigned by Node.js, so it never shadows real paths and no target can be
chosen. The entry point is taken from the mount the same way \fBnode <directory>\fR
takes one: the mount's own \fBpackage.json\fR \fB"main"\fR, or \fBindex.js\fR. Any
@@ -2004,16 +2006,15 @@ mounts it, whatever else that thread mounts, so a path into the mount means the
same thing in all of them.
A worker created with its own \fBexecArgv\fR inherits none of the parent's options,
and so does not mount the source at all. To run a script from the mount, such a
-worker must be given the same options again, \fB--experimental-vfs\fR and
-\fB--vfs-load\fR; without them, that thread has no mount for the script to come
-from, and the worker fails to load it. \fB--experimental-vfs\fR is also what makes
-\fBnode:vfs\fR available to the worker's own code. A worker whose script comes
-from anywhere else, such as the real file system, needs nothing added.
+worker must be given \fB--vfs-load\fR again; without it, that thread has no mount
+for the script to come from, and the worker fails to load it. \fBnode:vfs\fR is
+available to worker code without an experimental flag. A worker whose script
+comes from anywhere else, such as the real file system, needs nothing added.
\fB--vfs-load\fR is not permitted in \fBNODE_OPTIONS\fR: which entry point runs is
the command line's decision, and the environment must not be able to redirect
it.
.Bd -literal
-$ node --experimental-vfs --vfs-load=app.zip
+$ node --vfs-load=app.zip
.Ed
.
.It Fl -watch
@@ -2271,8 +2272,6 @@ one is included in the list below.
.It
\fB--experimental-top-level-await\fR
.It
-\fB--experimental-vfs\fR
-.It
\fB--experimental-vm-modules\fR
.It
\fB--experimental-wasi-unstable-preview1\fR
@@ -2341,6 +2340,8 @@ one is included in the list below.
.It
\fB--no-experimental-strip-types\fR
.It
+\fB--no-experimental-vfs\fR
+.It
\fB--no-experimental-webstorage\fR
.It
\fB--no-extra-info-on-fatal-exception\fR
diff --git a/lib/internal/vfs/file_system.js b/lib/internal/vfs/file_system.js
index 271359bf633..4f740579413 100644
--- a/lib/internal/vfs/file_system.js
+++ b/lib/internal/vfs/file_system.js
@@ -15,7 +15,6 @@ const {
ERR_INVALID_STATE,
},
} = require('internal/errors');
-const { validateBoolean } = require('internal/validators');
const { MemoryProvider } = require('internal/vfs/providers/memory');
const path = require('path');
const { posix: pathPosix, resolve: resolvePath, sep, toNamespacedPath } = path;
@@ -39,6 +38,7 @@ const {
const { VirtualReadStream, VirtualWriteStream } = require('internal/vfs/streams');
const { VirtualDir } = require('internal/vfs/dir');
const { emitExperimentalWarning, kEmptyObject } = require('internal/util');
+const { validateBoolean } = require('internal/validators');
let debug = require('internal/util/debuglog').debuglog('vfs', (fn) => {
debug = fn;
});
@@ -111,7 +111,6 @@ class VirtualFileSystem {
/**
* @param {VirtualProvider|object} [providerOrOptions] The provider to use, or options
* @param {object} [options] Configuration options
- * @param {boolean} [options.emitExperimentalWarning] Emit the experimental warning (default: true)
*/
constructor(providerOrOptions, options = kEmptyObject) {
let provider = null;
diff --git a/lib/vfs.js b/lib/vfs.js
index bcce0f6ffbc..dfb51f00bbb 100644
--- a/lib/vfs.js
+++ b/lib/vfs.js
@@ -4,6 +4,9 @@ const {
FunctionPrototypeSymbolHasInstance,
} = primordials;
+const { emitExperimentalWarning } = require('internal/util');
+emitExperimentalWarning('VirtualFileSystem');
+
const { VirtualFileSystem } = require('internal/vfs/file_system');
const { VirtualProvider } = require('internal/vfs/provider');
const { MemoryProvider } = require('internal/vfs/providers/memory');
diff --git a/src/node.cc b/src/node.cc
index d0b5310626c..e2efaad8a20 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -1119,7 +1119,7 @@ static ExitCode InitializeNodeWithArgsInternal(
{
auto* env_options = per_process::cli_options->per_isolate->per_env.get();
if (!env_options->experimental_vfs && env_options->vfs_load) {
- errors->push_back("--vfs-load requires --experimental-vfs");
+ errors->push_back("--vfs-load requires node:vfs to be enabled");
}
// A second --vfs-load would silently replace the first, and the option
// itself cannot say how often it was given; count it in the node options
diff --git a/src/node_options.cc b/src/node_options.cc
index acd98e6b927..db84f0c170a 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -801,7 +801,8 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
AddOption("--experimental-vfs",
"experimental node:vfs module",
BOOL_FIELD(experimental_vfs),
- kAllowedInEnvvar);
+ kAllowedInEnvvar,
+ true);
// Choosing the entry point is the command line's alone: an environment
// variable must not be able to redirect what a `node <args>` invocation runs,
// so this is rejected in NODE_OPTIONS. The source and whether to run from it
@@ -810,7 +811,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
AddOption("--vfs-load",
"mount a directory or archive as a virtual file system and run the "
"entry point and module resolution against it instead of the real "
- "file system (may be given once; requires --experimental-vfs)",
+ "file system (may be given once)",
&EnvironmentOptions::vfs_load_source,
kDisallowedInEnvvar);
AddOption("[vfs_load_set]", "", BOOL_FIELD(vfs_load));
diff --git a/src/node_options.h b/src/node_options.h
index 37e05101f56..8e6669e3aee 100644
--- a/src/node_options.h
+++ b/src/node_options.h
@@ -215,7 +215,7 @@ class EnvironmentOptions : public Options {
DEFINE_BOOL_FIELD(experimental_websocket) = true;
DEFINE_BOOL_FIELD(experimental_sqlite) = HAVE_SQLITE;
DEFINE_BOOL_FIELD(experimental_stream_iter) = EXPERIMENTALS_DEFAULT_VALUE;
- DEFINE_BOOL_FIELD(experimental_vfs) = EXPERIMENTALS_DEFAULT_VALUE;
+ DEFINE_BOOL_FIELD(experimental_vfs) = true;
DEFINE_BOOL_FIELD(vfs_load) = false;
DEFINE_BOOL_FIELD(webstorage) = HAVE_SQLITE;
DEFINE_BOOL_FIELD(experimental_dtls) = EXPERIMENTALS_DEFAULT_VALUE;
diff --git a/test/ffi/test-ffi-vfs.js b/test/ffi/test-ffi-vfs.js
index 884bd9f0d5d..37926e9c3dd 100644
--- a/test/ffi/test-ffi-vfs.js
+++ b/test/ffi/test-ffi-vfs.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
const common = require('../common');
common.skipIfFFIMissing();
diff --git a/test/parallel/test-module-builtin-experimental.js b/test/parallel/test-module-builtin-experimental.js
index 2a3d75e23c1..444c254b4ff 100644
--- a/test/parallel/test-module-builtin-experimental.js
+++ b/test/parallel/test-module-builtin-experimental.js
@@ -1,3 +1,4 @@
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
const common = require('../common');
@@ -8,7 +9,6 @@ const experimentalBuiltins = [
['bench/reporters', '--experimental-bench', true],
['dtls', '--experimental-dtls', common.hasDtls],
['quic', '--experimental-quic', common.hasQuic],
- ['vfs', '--experimental-vfs', true],
].filter(([, , available]) => available);
for (const [id, flag] of experimentalBuiltins) {
@@ -51,7 +51,14 @@ if (common.hasFFI) {
], { status: 0 });
}
-const schemeOnlyBuiltins = ['node:test', 'node:sea'];
+// node:vfs is enabled by default and can be disabled with
+// --no-experimental-vfs.
+spawnSyncAndAssert(process.execPath, [
+ '--no-experimental-vfs',
+ '-e', `const m = require('node:module'); if (m.builtinModules.includes('node:vfs')) process.exit(1); try { require('node:vfs'); } catch (e) { if (e.code === 'ERR_UNKNOWN_BUILTIN_MODULE') process.exit(0); } process.exit(1);`,
+], { status: 0 });
+
+const schemeOnlyBuiltins = ['node:test', 'node:sea', 'node:vfs'];
if (common.hasFFI) {
schemeOnlyBuiltins.push('node:ffi');
}
diff --git a/test/parallel/test-permission-dlopen-binary.js b/test/parallel/test-permission-dlopen-binary.js
index 3bf2321564f..d2c10245ac0 100644
--- a/test/parallel/test-permission-dlopen-binary.js
+++ b/test/parallel/test-permission-dlopen-binary.js
@@ -92,7 +92,7 @@ function run(...permissions) {
`;
const vfsRun = (...permissions) => spawnSync(
process.execPath,
- ['--experimental-vfs', '--permission', '--allow-fs-read=*',
+ ['--permission', '--allow-fs-read=*',
...permissions, '-e', mounted],
{ encoding: 'utf8' });
diff --git a/test/parallel/test-require-resolve.js b/test/parallel/test-require-resolve.js
index 039e6cd7adf..984afa78a1a 100644
--- a/test/parallel/test-require-resolve.js
+++ b/test/parallel/test-require-resolve.js
@@ -62,8 +62,6 @@ require(fixtures.path('resolve-paths', 'default', 'verify-paths.js'));
builtinModules.forEach((mod) => {
// TODO(@jasnell): Remove once node:quic is no longer flagged
if (mod === 'node:quic') return;
- // Remove once node:vfs is no longer flagged
- if (mod === 'node:vfs') return;
if (mod === 'node:sqlite' && !common.hasSQLite) return;
assert.strictEqual(require.resolve.paths(mod), null);
if (!mod.startsWith('node:')) {
diff --git a/test/parallel/test-vfs-access-modes.js b/test/parallel/test-vfs-access-modes.js
index 6b4854b204a..f07b8ecbb5f 100644
--- a/test/parallel/test-vfs-access-modes.js
+++ b/test/parallel/test-vfs-access-modes.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// access / accessSync honour the R_OK / W_OK / X_OK / F_OK mode bits and
diff --git a/test/parallel/test-vfs-addon.js b/test/parallel/test-vfs-addon.js
index 7ea8fdbf794..e28225a6c69 100644
--- a/test/parallel/test-vfs-addon.js
+++ b/test/parallel/test-vfs-addon.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
const common = require('../common');
const assert = require('assert');
diff --git a/test/parallel/test-vfs-append-write.js b/test/parallel/test-vfs-append-write.js
index fee8a137ade..1818022611a 100644
--- a/test/parallel/test-vfs-append-write.js
+++ b/test/parallel/test-vfs-append-write.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// writeSync in append mode must append, not overwrite.
diff --git a/test/parallel/test-vfs-bigint-position.js b/test/parallel/test-vfs-bigint-position.js
index d869f93947f..067a97ddbd4 100644
--- a/test/parallel/test-vfs-bigint-position.js
+++ b/test/parallel/test-vfs-bigint-position.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// VFS readSync should accept a BigInt position parameter.
diff --git a/test/parallel/test-vfs-callback-api.js b/test/parallel/test-vfs-callback-api.js
index dd95a5d7587..9591e57169c 100644
--- a/test/parallel/test-vfs-callback-api.js
+++ b/test/parallel/test-vfs-callback-api.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Exercise the VFS callback-style async API on every method.
diff --git a/test/parallel/test-vfs-copyfile-mode.js b/test/parallel/test-vfs-copyfile-mode.js
index 2d701f4f105..f18448b0e44 100644
--- a/test/parallel/test-vfs-copyfile-mode.js
+++ b/test/parallel/test-vfs-copyfile-mode.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Tests for VFS copyFile mode support:
diff --git a/test/parallel/test-vfs-create.js b/test/parallel/test-vfs-create.js
index 764e276f0e9..51d503077bf 100644
--- a/test/parallel/test-vfs-create.js
+++ b/test/parallel/test-vfs-create.js
@@ -1,7 +1,7 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
-// Constructor variants and option validation for vfs.create() and
+// Constructor variants for vfs.create() and
// `new VirtualFileSystem(...)`.
require('../common');
@@ -14,10 +14,9 @@ const vfs = require('node:vfs');
assert.ok(myVfs.provider instanceof vfs.MemoryProvider);
}
-// vfs.create with first arg as options object (no provider)
+// vfs.create with the options object as its first argument
{
const myVfs = vfs.create({ emitExperimentalWarning: false });
- assert.ok(myVfs);
assert.ok(myVfs.provider instanceof vfs.MemoryProvider);
}
@@ -28,7 +27,7 @@ const vfs = require('node:vfs');
assert.strictEqual(myVfs.provider, provider);
}
-// new VirtualFileSystem(options) directly
+// new VirtualFileSystem() directly
{
const myVfs = new vfs.VirtualFileSystem({ emitExperimentalWarning: false });
assert.ok(myVfs);
diff --git a/test/parallel/test-vfs-ctime-update.js b/test/parallel/test-vfs-ctime-update.js
index 227732ce74c..fe2b183a864 100644
--- a/test/parallel/test-vfs-ctime-update.js
+++ b/test/parallel/test-vfs-ctime-update.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
require('../common');
diff --git a/test/parallel/test-vfs-destructuring.js b/test/parallel/test-vfs-destructuring.js
index e38d15bbb73..3521ae886ea 100644
--- a/test/parallel/test-vfs-destructuring.js
+++ b/test/parallel/test-vfs-destructuring.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
const common = require('../common');
diff --git a/test/parallel/test-vfs-dir-handle.js b/test/parallel/test-vfs-dir-handle.js
index 6a26a69ce2d..8bbd51fd70e 100644
--- a/test/parallel/test-vfs-dir-handle.js
+++ b/test/parallel/test-vfs-dir-handle.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Exercise the VirtualDir handle returned by opendirSync.
diff --git a/test/parallel/test-vfs-fd.js b/test/parallel/test-vfs-fd.js
index f9f6b25f51c..1865e51c729 100644
--- a/test/parallel/test-vfs-fd.js
+++ b/test/parallel/test-vfs-fd.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
const common = require('../common');
diff --git a/test/parallel/test-vfs-file-handle.js b/test/parallel/test-vfs-file-handle.js
index 4b86714fbc5..4ffbb00f5c5 100644
--- a/test/parallel/test-vfs-file-handle.js
+++ b/test/parallel/test-vfs-file-handle.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Exercise VirtualFileHandle / MemoryFileHandle methods directly via
diff --git a/test/parallel/test-vfs-flag.js b/test/parallel/test-vfs-flag.js
index 14e34c9e8be..931884ce79e 100644
--- a/test/parallel/test-vfs-flag.js
+++ b/test/parallel/test-vfs-flag.js
@@ -1,59 +1,54 @@
'use strict';
-// node:vfs is gated behind --experimental-vfs. Without the flag the
-// module is not exposed; bare `vfs` (without the node: scheme) is also
-// blocked.
+// node:vfs is available without an experimental flag. The old positive flag
+// remains accepted for compatibility, and --no-experimental-vfs disables it.
require('../common');
const { spawnSyncAndAssert } = require('../common/child_process');
-// Without the flag, requiring node:vfs throws ERR_UNKNOWN_BUILTIN_MODULE.
-{
- spawnSyncAndAssert(process.execPath, [
- '-e', 'require("node:vfs")',
- ], { status: 1, stderr: /ERR_UNKNOWN_BUILTIN_MODULE/ });
-}
-
-// Without the flag, importing node:vfs throws ERR_UNKNOWN_BUILTIN_MODULE.
-{
- spawnSyncAndAssert(process.execPath, [
- '--input-type=module',
- '-e', 'import("node:vfs").catch((e) => { console.error(e.code); process.exit(1); });',
- ], {
- status: 1,
- stderr: /ERR_UNKNOWN_BUILTIN_MODULE/,
- });
-}
-
-// With the flag, node:vfs loads and works.
+// CommonJS and ESM can load node:vfs without a flag.
{
const script =
'const v = require("node:vfs");' +
'const x = v.create();' +
'x.writeFileSync("/x", "hi");' +
'console.log(x.readFileSync("/x", "utf8"));';
- spawnSyncAndAssert(process.execPath, ['--experimental-vfs', '-e', script], {
+ spawnSyncAndAssert(process.execPath, ['-e', script], {
stdout: 'hi',
+ stderr: /ExperimentalWarning: VirtualFileSystem is an experimental feature/,
trim: true,
});
-}
-// Bare `vfs` (no node: scheme) is always blocked.
-{
spawnSyncAndAssert(process.execPath, [
- '--experimental-vfs',
- '-e', "require('vfs')",
- ], { status: 1, stderr: /Cannot find module 'vfs'/ });
+ '--input-type=module',
+ '-e', 'import("node:vfs").then(({ default: v }) => console.log(typeof v.create));',
+ ], {
+ stdout: 'function\n',
+ stderr: /ExperimentalWarning: VirtualFileSystem is an experimental feature/,
+ });
}
-// Module.builtinModules reflects whether --experimental-vfs is active.
-for (const [flag, expected] of [
- ['--experimental-vfs', 'true\n'],
- ['--no-experimental-vfs', 'false\n'],
-]) {
- spawnSyncAndAssert(process.execPath, [
- flag,
- '-p',
- 'require("node:module").builtinModules.includes("node:vfs")',
- ], { stdout: expected, stderr: '' });
-}
+// The old positive flag is accepted for compatibility but no longer gates the
+// module.
+spawnSyncAndAssert(process.execPath, [
+ '--experimental-vfs',
+ '-p',
+ 'require("node:module").builtinModules.includes("node:vfs")',
+], { stdout: 'true\n', stderr: '' });
+
+// --no-experimental-vfs disables node:vfs.
+spawnSyncAndAssert(process.execPath, [
+ '--no-experimental-vfs',
+ '-p',
+ 'require("node:module").builtinModules.includes("node:vfs")',
+], { stdout: 'false\n', stderr: '' });
+
+spawnSyncAndAssert(process.execPath, [
+ '--no-experimental-vfs',
+ '-e', 'require("node:vfs")',
+], { status: 1, stderr: /ERR_UNKNOWN_BUILTIN_MODULE/ });
+
+// Bare `vfs` (no node: scheme) remains unavailable.
+spawnSyncAndAssert(process.execPath, [
+ '-e', "require('vfs')",
+], { status: 1, stderr: /Cannot find module 'vfs'/ });
diff --git a/test/parallel/test-vfs-fs-accessSync.js b/test/parallel/test-vfs-fs-accessSync.js
index 9d3469608ec..9cbadc7f378 100644
--- a/test/parallel/test-vfs-fs-accessSync.js
+++ b/test/parallel/test-vfs-fs-accessSync.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.accessSync dispatches to VFS; missing paths throw ENOENT.
diff --git a/test/parallel/test-vfs-fs-callback-error-paths.js b/test/parallel/test-vfs-fs-callback-error-paths.js
index 5cff379eda6..b38c4908a0e 100644
--- a/test/parallel/test-vfs-fs-callback-error-paths.js
+++ b/test/parallel/test-vfs-fs-callback-error-paths.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// VFS dispatch on the async callback fs methods must surface provider errors
diff --git a/test/parallel/test-vfs-fs-chmod-callback.js b/test/parallel/test-vfs-fs-chmod-callback.js
index 44f86833c39..db7eaef988c 100644
--- a/test/parallel/test-vfs-fs-chmod-callback.js
+++ b/test/parallel/test-vfs-fs-chmod-callback.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.chmod, fs.chown, fs.lchown, fs.utimes, and fs.lutimes callbacks dispatch
diff --git a/test/parallel/test-vfs-fs-chmodSync.js b/test/parallel/test-vfs-fs-chmodSync.js
index 91a63c36129..95b670da51c 100644
--- a/test/parallel/test-vfs-fs-chmodSync.js
+++ b/test/parallel/test-vfs-fs-chmodSync.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.chmodSync, fs.chownSync, fs.lchownSync, fs.utimesSync, and
diff --git a/test/parallel/test-vfs-fs-copyFileSync.js b/test/parallel/test-vfs-fs-copyFileSync.js
index 3383b460862..9056991bd9b 100644
--- a/test/parallel/test-vfs-fs-copyFileSync.js
+++ b/test/parallel/test-vfs-fs-copyFileSync.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.copyFileSync dispatches to VFS when both paths are within the same mount.
diff --git a/test/parallel/test-vfs-fs-createReadStream.js b/test/parallel/test-vfs-fs-createReadStream.js
index 357d7db2b92..55bd267dbb6 100644
--- a/test/parallel/test-vfs-fs-createReadStream.js
+++ b/test/parallel/test-vfs-fs-createReadStream.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.createReadStream dispatches through VFS, including the emitted 'open'
diff --git a/test/parallel/test-vfs-fs-createWriteStream.js b/test/parallel/test-vfs-fs-createWriteStream.js
index 495d4108db3..52ebab4f31b 100644
--- a/test/parallel/test-vfs-fs-createWriteStream.js
+++ b/test/parallel/test-vfs-fs-createWriteStream.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.createWriteStream dispatches through VFS, exposes a `path` property and
diff --git a/test/parallel/test-vfs-fs-existsSync.js b/test/parallel/test-vfs-fs-existsSync.js
index 5bb6df4c1c2..4adbfb64f03 100644
--- a/test/parallel/test-vfs-fs-existsSync.js
+++ b/test/parallel/test-vfs-fs-existsSync.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.existsSync dispatches to VFS for paths under a mount.
diff --git a/test/parallel/test-vfs-fs-fchmod-callback.js b/test/parallel/test-vfs-fs-fchmod-callback.js
index e46fd27af42..2deb28d125b 100644
--- a/test/parallel/test-vfs-fs-fchmod-callback.js
+++ b/test/parallel/test-vfs-fs-fchmod-callback.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.fchmod, fs.fchown, fs.futimes, fs.fdatasync, and fs.fsync callbacks
diff --git a/test/parallel/test-vfs-fs-linkSync.js b/test/parallel/test-vfs-fs-linkSync.js
index e73bcc76df0..cc50992e0d4 100644
--- a/test/parallel/test-vfs-fs-linkSync.js
+++ b/test/parallel/test-vfs-fs-linkSync.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.linkSync dispatches to VFS for hard links within the same mount.
diff --git a/test/parallel/test-vfs-fs-matches-real-fs.js b/test/parallel/test-vfs-fs-matches-real-fs.js
index a500d796599..7f80d3af1fb 100644
--- a/test/parallel/test-vfs-fs-matches-real-fs.js
+++ b/test/parallel/test-vfs-fs-matches-real-fs.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// `node:fs` entry points route mounted paths through the VFS hooks. Where a
diff --git a/test/parallel/test-vfs-fs-mkdir-callback.js b/test/parallel/test-vfs-fs-mkdir-callback.js
index 4caccda70f6..3386596a1d9 100644
--- a/test/parallel/test-vfs-fs-mkdir-callback.js
+++ b/test/parallel/test-vfs-fs-mkdir-callback.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.mkdir, fs.rmdir, fs.rm, and fs.unlink callbacks dispatch through VFS.
diff --git a/test/parallel/test-vfs-fs-mkdirSync.js b/test/parallel/test-vfs-fs-mkdirSync.js
index 83942b8856b..493185113a5 100644
--- a/test/parallel/test-vfs-fs-mkdirSync.js
+++ b/test/parallel/test-vfs-fs-mkdirSync.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.mkdirSync dispatches to VFS, including the `recursive: true` form.
diff --git a/test/parallel/test-vfs-fs-mkdtempSync.js b/test/parallel/test-vfs-fs-mkdtempSync.js
index 2fd1e81d709..e14f0fafe4d 100644
--- a/test/parallel/test-vfs-fs-mkdtempSync.js
+++ b/test/parallel/test-vfs-fs-mkdtempSync.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.mkdtempSync dispatches to VFS and returns a mount-rooted path, including
diff --git a/test/parallel/test-vfs-fs-open-callback.js b/test/parallel/test-vfs-fs-open-callback.js
index 23a4f8ccadb..88ba781c269 100644
--- a/test/parallel/test-vfs-fs-open-callback.js
+++ b/test/parallel/test-vfs-fs-open-callback.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.open / fs.fstat / fs.read / fs.write / fs.close / fs.ftruncate callbacks
diff --git a/test/parallel/test-vfs-fs-openAsBlob.js b/test/parallel/test-vfs-fs-openAsBlob.js
index d00b7533804..60be82efff1 100644
--- a/test/parallel/test-vfs-fs-openAsBlob.js
+++ b/test/parallel/test-vfs-fs-openAsBlob.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.openAsBlob and fs.openAsBlobSync dispatch to VFS and return Blobs over the virtual file.
diff --git a/test/parallel/test-vfs-fs-openSync.js b/test/parallel/test-vfs-fs-openSync.js
index d1155e36cb1..cd2b97c4cdd 100644
--- a/test/parallel/test-vfs-fs-openSync.js
+++ b/test/parallel/test-vfs-fs-openSync.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.openSync / fs.readSync / fs.writeSync / fs.fstatSync / fs.closeSync /
diff --git a/test/parallel/test-vfs-fs-opendir-callback.js b/test/parallel/test-vfs-fs-opendir-callback.js
index 6b1f6fe5f88..1f16ca3c59f 100644
--- a/test/parallel/test-vfs-fs-opendir-callback.js
+++ b/test/parallel/test-vfs-fs-opendir-callback.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.opendir callback dispatches through VFS, both via readSync() iteration
diff --git a/test/parallel/test-vfs-fs-opendirSync.js b/test/parallel/test-vfs-fs-opendirSync.js
index 260b3114d10..21d5b6bbc91 100644
--- a/test/parallel/test-vfs-fs-opendirSync.js
+++ b/test/parallel/test-vfs-fs-opendirSync.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.opendirSync dispatches to VFS and returns a Dir-like iterable.
diff --git a/test/parallel/test-vfs-fs-promises-buffer-encoding.js b/test/parallel/test-vfs-fs-promises-buffer-encoding.js
index 0c371c9c458..b77bc83dec5 100644
--- a/test/parallel/test-vfs-fs-promises-buffer-encoding.js
+++ b/test/parallel/test-vfs-fs-promises-buffer-encoding.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// The promise-based fs methods that accept `encoding: 'buffer'` must convert
diff --git a/test/parallel/test-vfs-fs-promises-stat-no-throw.js b/test/parallel/test-vfs-fs-promises-stat-no-throw.js
index 0b9b28ea101..5cc237771e6 100644
--- a/test/parallel/test-vfs-fs-promises-stat-no-throw.js
+++ b/test/parallel/test-vfs-fs-promises-stat-no-throw.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fsp.stat() with throwIfNoEntry: false on a missing path within a mount
diff --git a/test/parallel/test-vfs-fs-promises.js b/test/parallel/test-vfs-fs-promises.js
index b720aad37cc..f07d466bfaa 100644
--- a/test/parallel/test-vfs-fs-promises.js
+++ b/test/parallel/test-vfs-fs-promises.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs/promises dispatches through VFS for each supported path-based and
diff --git a/test/parallel/test-vfs-fs-readFile-callback.js b/test/parallel/test-vfs-fs-readFile-callback.js
index 653e79e395a..8fff0cf054f 100644
--- a/test/parallel/test-vfs-fs-readFile-callback.js
+++ b/test/parallel/test-vfs-fs-readFile-callback.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.readFile, fs.readdir, fs.realpath, fs.access, and fs.exists callbacks
diff --git a/test/parallel/test-vfs-fs-readFileSync.js b/test/parallel/test-vfs-fs-readFileSync.js
index 297a8855101..5426d35d981 100644
--- a/test/parallel/test-vfs-fs-readFileSync.js
+++ b/test/parallel/test-vfs-fs-readFileSync.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.readFileSync dispatches to VFS for both string paths and VFS-owned fds.
diff --git a/test/parallel/test-vfs-fs-readdirSync.js b/test/parallel/test-vfs-fs-readdirSync.js
index ee1a1a258b3..5c448acd034 100644
--- a/test/parallel/test-vfs-fs-readdirSync.js
+++ b/test/parallel/test-vfs-fs-readdirSync.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.readdirSync dispatches to VFS, including the buffer-encoding and
diff --git a/test/parallel/test-vfs-fs-realpathSync.js b/test/parallel/test-vfs-fs-realpathSync.js
index 2d87b1e87d3..30ddcd65a92 100644
--- a/test/parallel/test-vfs-fs-realpathSync.js
+++ b/test/parallel/test-vfs-fs-realpathSync.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.realpathSync dispatches to VFS and returns a mount-rooted absolute path.
diff --git a/test/parallel/test-vfs-fs-rename-callback.js b/test/parallel/test-vfs-fs-rename-callback.js
index dd426c181e4..497304833dc 100644
--- a/test/parallel/test-vfs-fs-rename-callback.js
+++ b/test/parallel/test-vfs-fs-rename-callback.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.rename and fs.copyFile callbacks dispatch through VFS.
diff --git a/test/parallel/test-vfs-fs-renameSync.js b/test/parallel/test-vfs-fs-renameSync.js
index 1f1cbf6b394..469fb773280 100644
--- a/test/parallel/test-vfs-fs-renameSync.js
+++ b/test/parallel/test-vfs-fs-renameSync.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.renameSync dispatches to VFS when both paths are within the same mount.
diff --git a/test/parallel/test-vfs-fs-rmSync.js b/test/parallel/test-vfs-fs-rmSync.js
index 4f3af281d61..2174be7b469 100644
--- a/test/parallel/test-vfs-fs-rmSync.js
+++ b/test/parallel/test-vfs-fs-rmSync.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.rmSync, fs.rmdirSync, and fs.unlinkSync dispatch to VFS.
diff --git a/test/parallel/test-vfs-fs-stat-callback.js b/test/parallel/test-vfs-fs-stat-callback.js
index bd3494b73fe..d44a426faeb 100644
--- a/test/parallel/test-vfs-fs-stat-callback.js
+++ b/test/parallel/test-vfs-fs-stat-callback.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.stat and fs.lstat callbacks dispatch through VFS.
diff --git a/test/parallel/test-vfs-fs-statSync.js b/test/parallel/test-vfs-fs-statSync.js
index 6e5d27c3059..28150f248b1 100644
--- a/test/parallel/test-vfs-fs-statSync.js
+++ b/test/parallel/test-vfs-fs-statSync.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.statSync / fs.lstatSync / fs.statfsSync dispatch through the VFS layer,
diff --git a/test/parallel/test-vfs-fs-symlink-callback.js b/test/parallel/test-vfs-fs-symlink-callback.js
index e35eeb38b98..ee2ce8b989e 100644
--- a/test/parallel/test-vfs-fs-symlink-callback.js
+++ b/test/parallel/test-vfs-fs-symlink-callback.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.symlink and fs.readlink callbacks dispatch through VFS.
diff --git a/test/parallel/test-vfs-fs-symlinkSync.js b/test/parallel/test-vfs-fs-symlinkSync.js
index 5a39cc281e0..d27914ab2e5 100644
--- a/test/parallel/test-vfs-fs-symlinkSync.js
+++ b/test/parallel/test-vfs-fs-symlinkSync.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.symlinkSync and fs.readlinkSync dispatch through VFS, including the
diff --git a/test/parallel/test-vfs-fs-truncate-callback.js b/test/parallel/test-vfs-fs-truncate-callback.js
index 1399bf6ed14..a2f00f35121 100644
--- a/test/parallel/test-vfs-fs-truncate-callback.js
+++ b/test/parallel/test-vfs-fs-truncate-callback.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.truncate, fs.link, and fs.mkdtemp callbacks dispatch through VFS.
diff --git a/test/parallel/test-vfs-fs-truncateSync.js b/test/parallel/test-vfs-fs-truncateSync.js
index d4ed16f8fb8..218a4d912c6 100644
--- a/test/parallel/test-vfs-fs-truncateSync.js
+++ b/test/parallel/test-vfs-fs-truncateSync.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.truncateSync dispatches to VFS and shrinks the file content.
diff --git a/test/parallel/test-vfs-fs-watch-dispatch.js b/test/parallel/test-vfs-fs-watch-dispatch.js
index e9952919193..08ea064e3df 100644
--- a/test/parallel/test-vfs-fs-watch-dispatch.js
+++ b/test/parallel/test-vfs-fs-watch-dispatch.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.watch on a path under a mount returns the provider's watcher object
diff --git a/test/parallel/test-vfs-fs-writeFile-callback.js b/test/parallel/test-vfs-fs-writeFile-callback.js
index ce22b6b8811..aa2b2c49668 100644
--- a/test/parallel/test-vfs-fs-writeFile-callback.js
+++ b/test/parallel/test-vfs-fs-writeFile-callback.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.writeFile and fs.appendFile callbacks dispatch through VFS.
diff --git a/test/parallel/test-vfs-fs-writeFileSync.js b/test/parallel/test-vfs-fs-writeFileSync.js
index 7bde5f6c7b8..8e2bd949877 100644
--- a/test/parallel/test-vfs-fs-writeFileSync.js
+++ b/test/parallel/test-vfs-fs-writeFileSync.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// fs.writeFileSync and fs.appendFileSync dispatch to VFS.
diff --git a/test/parallel/test-vfs-handle-semantics.js b/test/parallel/test-vfs-handle-semantics.js
index 3cd38fb7f83..4243b665abb 100644
--- a/test/parallel/test-vfs-handle-semantics.js
+++ b/test/parallel/test-vfs-handle-semantics.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// A file handle on a mounted path must answer the same `node:fs` calls the
diff --git a/test/parallel/test-vfs-hardlink-nlink.js b/test/parallel/test-vfs-hardlink-nlink.js
index 8a58d0e9d59..7a69fc0bf84 100644
--- a/test/parallel/test-vfs-hardlink-nlink.js
+++ b/test/parallel/test-vfs-hardlink-nlink.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Test that nlink count is updated correctly when creating/removing hard links.
diff --git a/test/parallel/test-vfs-import.mjs b/test/parallel/test-vfs-import.mjs
index 03e1047c7b7..2dd359ad9ab 100644
--- a/test/parallel/test-vfs-import.mjs
+++ b/test/parallel/test-vfs-import.mjs
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
import '../common/index.mjs';
import assert from 'assert';
import { pathToFileURL } from 'node:url';
diff --git a/test/parallel/test-vfs-invalid-package-json.js b/test/parallel/test-vfs-invalid-package-json.js
index 99589d16afb..1b7202464d0 100644
--- a/test/parallel/test-vfs-invalid-package-json.js
+++ b/test/parallel/test-vfs-invalid-package-json.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs --expose-internals
+// Flags: --disable-warning=ExperimentalWarning --expose-internals
'use strict';
const common = require('../common');
diff --git a/test/parallel/test-vfs-layer-tag-prefix.mjs b/test/parallel/test-vfs-layer-tag-prefix.mjs
index c4083e53999..1b6ce588579 100644
--- a/test/parallel/test-vfs-layer-tag-prefix.mjs
+++ b/test/parallel/test-vfs-layer-tag-prefix.mjs
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
// Regression: unmounting a layer whose id is a decimal prefix of another
// (e.g. layer 1 vs layer 10) must not purge the other's ESM cache entries.
diff --git a/test/parallel/test-vfs-lchown-symlink.js b/test/parallel/test-vfs-lchown-symlink.js
index 6154e9fb2de..a89d5d88722 100644
--- a/test/parallel/test-vfs-lchown-symlink.js
+++ b/test/parallel/test-vfs-lchown-symlink.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
const common = require('../common');
diff --git a/test/parallel/test-vfs-link.js b/test/parallel/test-vfs-link.js
index 6925ad004fd..9596b6346d4 100644
--- a/test/parallel/test-vfs-link.js
+++ b/test/parallel/test-vfs-link.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Hard-link error cases: creating a link to a directory or to an
diff --git a/test/parallel/test-vfs-load.js b/test/parallel/test-vfs-load.js
index 09db73c8fac..27735d86773 100644
--- a/test/parallel/test-vfs-load.js
+++ b/test/parallel/test-vfs-load.js
@@ -22,7 +22,7 @@ let id = 0;
function fixture(name) { return path.join(tmpdir.path, `${id++}-${name}`); }
function run(args) {
- return spawnSync(process.execPath, ['--experimental-vfs', ...args], { encoding: 'utf8' });
+ return spawnSync(process.execPath, args, { encoding: 'utf8' });
}
// Node.js can be built without NODE_OPTIONS support, in which case the
@@ -49,6 +49,15 @@ function envArg(flag, value) {
assert.match(res.stdout, /hello from inside the mount/);
}
+// --no-experimental-vfs disables --vfs-load.
+{
+ const dir = fixture('disabled');
+ fs.mkdirSync(dir, { recursive: true });
+ const res = run(['--no-experimental-vfs', `--vfs-load=${dir}`]);
+ assert.notStrictEqual(res.status, 0);
+ assert.match(res.stderr, /--vfs-load requires node:vfs to be enabled/);
+}
+
// A provider registered by a -r (CommonJS) preload backs a custom file format.
{
const providerModule = fixture('provider.js');
@@ -198,7 +207,7 @@ parentPort.postMessage('hello from esm worker in mount');
const path = require('path');
const { Worker } = require('worker_threads');
const w = new Worker(path.join(__dirname, 'worker.js'), {
- execArgv: ['--experimental-vfs', '--vfs-load=' + process.argv[1]],
+ execArgv: ['--vfs-load=' + process.argv[1]],
});
w.on('message', (m) => { console.log(m); process.exit(0); });
w.on('error', (e) => { console.error(e); process.exit(1); });
@@ -308,8 +317,7 @@ if (hasNodeOptions) {
// On its own, and alongside a --vfs-load the command line legitimately gave:
// the environment is refused either way rather than merged.
- for (const args of [['--experimental-vfs'],
- ['--experimental-vfs', `--vfs-load=${dir}`]]) {
+ for (const args of [[], [`--vfs-load=${dir}`]]) {
const res = spawnSync(process.execPath, args, {
encoding: 'utf8',
env: { ...process.env, NODE_OPTIONS: envArg('--vfs-load', dir) },
@@ -319,10 +327,8 @@ if (hasNodeOptions) {
}
}
-// --experimental-vfs and --vfs-load may arrive from different places: the
-// options are validated once every source has been parsed, so a --vfs-load on
-// the command line is not rejected for an --experimental-vfs that only
-// NODE_OPTIONS carries.
+// The old --experimental-vfs option remains accepted in NODE_OPTIONS. Its
+// positive form no longer gates --vfs-load, and its negated form disables it.
if (hasNodeOptions) {
const dir = fixture('env-flag-cli-load');
fs.mkdirSync(dir, { recursive: true });
@@ -334,6 +340,13 @@ if (hasNodeOptions) {
});
assert.strictEqual(res.status, 0, res.stderr);
assert.match(res.stdout, /ran/);
+
+ const disabled = spawnSync(process.execPath, [`--vfs-load=${dir}`], {
+ encoding: 'utf8',
+ env: { ...process.env, NODE_OPTIONS: '--no-experimental-vfs' },
+ });
+ assert.notStrictEqual(disabled.status, 0);
+ assert.match(disabled.stderr, /--vfs-load requires node:vfs to be enabled/);
}
// Under --vfs-load the entry point comes from the mount, so no positional
diff --git a/test/parallel/test-vfs-memory-file-handle.js b/test/parallel/test-vfs-memory-file-handle.js
index 5a00b437a33..30dcdb5f0e8 100644
--- a/test/parallel/test-vfs-memory-file-handle.js
+++ b/test/parallel/test-vfs-memory-file-handle.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs --expose-internals
+// Flags: --disable-warning=ExperimentalWarning --expose-internals
'use strict';
// MemoryFileHandle internals: the "stats not available" path when there
diff --git a/test/parallel/test-vfs-memory-provider-dynamic.js b/test/parallel/test-vfs-memory-provider-dynamic.js
index 13ed609820e..a70abe179aa 100644
--- a/test/parallel/test-vfs-memory-provider-dynamic.js
+++ b/test/parallel/test-vfs-memory-provider-dynamic.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs --expose-internals
+// Flags: --disable-warning=ExperimentalWarning --expose-internals
'use strict';
// MemoryProvider supports dynamic content providers and lazily-populated
diff --git a/test/parallel/test-vfs-memory-provider-flags.js b/test/parallel/test-vfs-memory-provider-flags.js
index 08963208278..d9cadf08f10 100644
--- a/test/parallel/test-vfs-memory-provider-flags.js
+++ b/test/parallel/test-vfs-memory-provider-flags.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// MemoryProvider: numeric open flags (mirroring fs.constants.O_*) must be
diff --git a/test/parallel/test-vfs-memory-provider.js b/test/parallel/test-vfs-memory-provider.js
index c45ee69f679..9b479549cce 100644
--- a/test/parallel/test-vfs-memory-provider.js
+++ b/test/parallel/test-vfs-memory-provider.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs --expose-internals
+// Flags: --disable-warning=ExperimentalWarning --expose-internals
'use strict';
const common = require('../common');
diff --git a/test/parallel/test-vfs-mkdir.js b/test/parallel/test-vfs-mkdir.js
index 22487324d24..f446a72ba6b 100644
--- a/test/parallel/test-vfs-mkdir.js
+++ b/test/parallel/test-vfs-mkdir.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// mkdirSync / rmdirSync behaviour: return value, recursive option, mode
diff --git a/test/parallel/test-vfs-mkdtemp.js b/test/parallel/test-vfs-mkdtemp.js
index f2140e2bc7d..d86c88046e5 100644
--- a/test/parallel/test-vfs-mkdtemp.js
+++ b/test/parallel/test-vfs-mkdtemp.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// mkdtemp / mkdtempSync behaviour.
diff --git a/test/parallel/test-vfs-module-hooks-cleanup.js b/test/parallel/test-vfs-module-hooks-cleanup.js
index 825957497d1..23747c5ac5c 100644
--- a/test/parallel/test-vfs-module-hooks-cleanup.js
+++ b/test/parallel/test-vfs-module-hooks-cleanup.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
const common = require('../common');
diff --git a/test/parallel/test-vfs-module-hooks.mjs b/test/parallel/test-vfs-module-hooks.mjs
index 9629b3bdbaf..b48b2e1235d 100644
--- a/test/parallel/test-vfs-module-hooks.mjs
+++ b/test/parallel/test-vfs-module-hooks.mjs
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
import '../common/index.mjs';
import assert from 'assert';
import { createRequire } from 'module';
diff --git a/test/parallel/test-vfs-module-paths.js b/test/parallel/test-vfs-module-paths.js
index 25c0ce0ba26..f3b48052160 100644
--- a/test/parallel/test-vfs-module-paths.js
+++ b/test/parallel/test-vfs-module-paths.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// The `node_modules` lookup for modules inside a mounted VFS stops at the
@@ -91,7 +91,7 @@ const tmpdir = require('../common/tmpdir');
fs.writeFileSync(path.join(globalDir, 'gdep', 'index.js'),
'module.exports = "from-node-path";');
- const out = execFileSync(process.execPath, ['--experimental-vfs', '-e', `
+ const out = execFileSync(process.execPath, ['-e', `
const vfs = require('node:vfs');
const path = require('path');
const myVfs = vfs.create();
diff --git a/test/parallel/test-vfs-mount-errors.js b/test/parallel/test-vfs-mount-errors.js
index dd0fef60642..a686dc3e4e3 100644
--- a/test/parallel/test-vfs-mount-errors.js
+++ b/test/parallel/test-vfs-mount-errors.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs --expose-internals
+// Flags: --disable-warning=ExperimentalWarning --expose-internals
'use strict';
// Error paths in the VFS mount layer:
diff --git a/test/parallel/test-vfs-mount-point-url.js b/test/parallel/test-vfs-mount-point-url.js
index 717919a2690..76f5de46964 100644
--- a/test/parallel/test-vfs-mount-point-url.js
+++ b/test/parallel/test-vfs-mount-point-url.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
require('../common');
diff --git a/test/parallel/test-vfs-mount.js b/test/parallel/test-vfs-mount.js
index 2334e7d1e7e..3dc35fe6bd5 100644
--- a/test/parallel/test-vfs-mount.js
+++ b/test/parallel/test-vfs-mount.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
const common = require('../common');
diff --git a/test/parallel/test-vfs-multi-mount.js b/test/parallel/test-vfs-multi-mount.js
index 7539c0a6f02..7a6db448ce3 100644
--- a/test/parallel/test-vfs-multi-mount.js
+++ b/test/parallel/test-vfs-multi-mount.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Two concurrent mounts must each route to its own VFS without
diff --git a/test/parallel/test-vfs-package-json-cache.js b/test/parallel/test-vfs-package-json-cache.js
index 7a787d613fc..db897e674d7 100644
--- a/test/parallel/test-vfs-package-json-cache.js
+++ b/test/parallel/test-vfs-package-json-cache.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Package.json caches must be cleared on VFS unmount.
diff --git a/test/parallel/test-vfs-package-json.js b/test/parallel/test-vfs-package-json.js
index 9b8dbe86812..6cd0f5794ac 100644
--- a/test/parallel/test-vfs-package-json.js
+++ b/test/parallel/test-vfs-package-json.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs --expose-internals
+// Flags: --disable-warning=ExperimentalWarning --expose-internals
'use strict';
require('../common');
diff --git a/test/parallel/test-vfs-parent-timestamps.js b/test/parallel/test-vfs-parent-timestamps.js
index d12b2e7ec54..2cef93602f0 100644
--- a/test/parallel/test-vfs-parent-timestamps.js
+++ b/test/parallel/test-vfs-parent-timestamps.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Operations that modify a directory should bump its mtime/ctime.
diff --git a/test/parallel/test-vfs-promises-open.js b/test/parallel/test-vfs-promises-open.js
index 280627ce73b..5f21c3dde2e 100644
--- a/test/parallel/test-vfs-promises-open.js
+++ b/test/parallel/test-vfs-promises-open.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// VFS promises.open returns a usable handle.
diff --git a/test/parallel/test-vfs-promises.js b/test/parallel/test-vfs-promises.js
index 85b1b68b1a1..affccf28db0 100644
--- a/test/parallel/test-vfs-promises.js
+++ b/test/parallel/test-vfs-promises.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs --expose-internals
+// Flags: --disable-warning=ExperimentalWarning --expose-internals
'use strict';
const common = require('../common');
diff --git a/test/parallel/test-vfs-readdir-symlink-recursive.js b/test/parallel/test-vfs-readdir-symlink-recursive.js
index ce0538ec1ca..e088118c9c8 100644
--- a/test/parallel/test-vfs-readdir-symlink-recursive.js
+++ b/test/parallel/test-vfs-readdir-symlink-recursive.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Recursive readdir must follow symlinks to directories.
diff --git a/test/parallel/test-vfs-readfile-async.js b/test/parallel/test-vfs-readfile-async.js
index 79580a91597..033af3488f2 100644
--- a/test/parallel/test-vfs-readfile-async.js
+++ b/test/parallel/test-vfs-readfile-async.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// VFS readFile callback API.
diff --git a/test/parallel/test-vfs-readfile-encoding.js b/test/parallel/test-vfs-readfile-encoding.js
index c80a56cce35..86a9fdee8e2 100644
--- a/test/parallel/test-vfs-readfile-encoding.js
+++ b/test/parallel/test-vfs-readfile-encoding.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// readFileSync with invalid encoding must throw.
diff --git a/test/parallel/test-vfs-readfile-flag.js b/test/parallel/test-vfs-readfile-flag.js
index 5fcfc902b79..99e2a9f3160 100644
--- a/test/parallel/test-vfs-readfile-flag.js
+++ b/test/parallel/test-vfs-readfile-flag.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
const common = require('../common');
diff --git a/test/parallel/test-vfs-real-provider-handle.js b/test/parallel/test-vfs-real-provider-handle.js
index e7b5465a594..7910e6f7876 100644
--- a/test/parallel/test-vfs-real-provider-handle.js
+++ b/test/parallel/test-vfs-real-provider-handle.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs --expose-internals
+// Flags: --disable-warning=ExperimentalWarning --expose-internals
'use strict';
// RealFileHandle: sync and async file-handle operations, plus EBADF
diff --git a/test/parallel/test-vfs-real-provider-promises.js b/test/parallel/test-vfs-real-provider-promises.js
index 932a30fd086..21ff7533993 100644
--- a/test/parallel/test-vfs-real-provider-promises.js
+++ b/test/parallel/test-vfs-real-provider-promises.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Promises API for RealFSProvider: every async/promises method,
diff --git a/test/parallel/test-vfs-real-provider-symlinks.js b/test/parallel/test-vfs-real-provider-symlinks.js
index d84c17ecd84..5c946bbfad8 100644
--- a/test/parallel/test-vfs-real-provider-symlinks.js
+++ b/test/parallel/test-vfs-real-provider-symlinks.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Symlink and path-escape behaviour for RealFSProvider.
diff --git a/test/parallel/test-vfs-real-provider-watch.js b/test/parallel/test-vfs-real-provider-watch.js
index 056744c5fd0..03563256202 100644
--- a/test/parallel/test-vfs-real-provider-watch.js
+++ b/test/parallel/test-vfs-real-provider-watch.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// watch / promises.watch / watchFile through RealFSProvider.
diff --git a/test/parallel/test-vfs-real-provider.js b/test/parallel/test-vfs-real-provider.js
index a54181d8f6d..6ddba52aa73 100644
--- a/test/parallel/test-vfs-real-provider.js
+++ b/test/parallel/test-vfs-real-provider.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Synchronous API for RealFSProvider: construction, basic file ops,
diff --git a/test/parallel/test-vfs-rename-symlink-descendant.js b/test/parallel/test-vfs-rename-symlink-descendant.js
index 4781f804531..b7471f4baca 100644
--- a/test/parallel/test-vfs-rename-symlink-descendant.js
+++ b/test/parallel/test-vfs-rename-symlink-descendant.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
const common = require('../common');
diff --git a/test/parallel/test-vfs-rename.js b/test/parallel/test-vfs-rename.js
index b1ca98dc684..5468bd6f4f2 100644
--- a/test/parallel/test-vfs-rename.js
+++ b/test/parallel/test-vfs-rename.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Rename behaviour: overwrite, type mismatches, same-parent rename.
diff --git a/test/parallel/test-vfs-require.js b/test/parallel/test-vfs-require.js
index 3e686967227..a10a311551d 100644
--- a/test/parallel/test-vfs-require.js
+++ b/test/parallel/test-vfs-require.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
const common = require('../common');
diff --git a/test/parallel/test-vfs-reserved-root-unowned.js b/test/parallel/test-vfs-reserved-root-unowned.js
index e6a5b319f61..1a7420f4375 100644
--- a/test/parallel/test-vfs-reserved-root-unowned.js
+++ b/test/parallel/test-vfs-reserved-root-unowned.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs --expose-internals
+// Flags: --disable-warning=ExperimentalWarning --expose-internals
'use strict';
// The module loader manufactures paths under the reserved VFS root that no
diff --git a/test/parallel/test-vfs-reserved-root.js b/test/parallel/test-vfs-reserved-root.js
index 9de39fb8ff9..c8c04a170d8 100644
--- a/test/parallel/test-vfs-reserved-root.js
+++ b/test/parallel/test-vfs-reserved-root.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
const common = require('../common');
diff --git a/test/parallel/test-vfs-rm-edge-cases.js b/test/parallel/test-vfs-rm-edge-cases.js
index 9961940aea8..99fceb3c828 100644
--- a/test/parallel/test-vfs-rm-edge-cases.js
+++ b/test/parallel/test-vfs-rm-edge-cases.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Tests for VFS rmSync edge cases:
diff --git a/test/parallel/test-vfs-rmdir-symlink.js b/test/parallel/test-vfs-rmdir-symlink.js
index fba1981322f..b28da8fdeaf 100644
--- a/test/parallel/test-vfs-rmdir-symlink.js
+++ b/test/parallel/test-vfs-rmdir-symlink.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// rmdirSync on a symlink to a directory should throw ENOTDIR
diff --git a/test/parallel/test-vfs-router.js b/test/parallel/test-vfs-router.js
index 292e33e7379..b7750490671 100644
--- a/test/parallel/test-vfs-router.js
+++ b/test/parallel/test-vfs-router.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs --expose-internals
+// Flags: --disable-warning=ExperimentalWarning --expose-internals
'use strict';
// Unit-level coverage for the mount-router helpers in
diff --git a/test/parallel/test-vfs-scoped-cache-purge.js b/test/parallel/test-vfs-scoped-cache-purge.js
index 104089cd4a2..031dc58cd15 100644
--- a/test/parallel/test-vfs-scoped-cache-purge.js
+++ b/test/parallel/test-vfs-scoped-cache-purge.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Deregistering one VFS must scope-purge loader caches: entries under the
diff --git a/test/parallel/test-vfs-stats-bigint.js b/test/parallel/test-vfs-stats-bigint.js
index 074ac9fa379..40036ade321 100644
--- a/test/parallel/test-vfs-stats-bigint.js
+++ b/test/parallel/test-vfs-stats-bigint.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Verify { bigint: true } returns BigInt values for VFS stats.
diff --git a/test/parallel/test-vfs-stats-helpers.js b/test/parallel/test-vfs-stats-helpers.js
index 3df0701138c..252aed7d405 100644
--- a/test/parallel/test-vfs-stats-helpers.js
+++ b/test/parallel/test-vfs-stats-helpers.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs --expose-internals
+// Flags: --disable-warning=ExperimentalWarning --expose-internals
'use strict';
// Exercise the default-option paths in createFileStats / createDirectoryStats
diff --git a/test/parallel/test-vfs-stats-ino-dev.js b/test/parallel/test-vfs-stats-ino-dev.js
index 9a5e69d603b..b9c8e0ffff6 100644
--- a/test/parallel/test-vfs-stats-ino-dev.js
+++ b/test/parallel/test-vfs-stats-ino-dev.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// VFS stats must have non-zero, unique ino and a distinctive dev.
diff --git a/test/parallel/test-vfs-stream-errors.js b/test/parallel/test-vfs-stream-errors.js
index df006d5cf3d..0ad4f5986b5 100644
--- a/test/parallel/test-vfs-stream-errors.js
+++ b/test/parallel/test-vfs-stream-errors.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Error paths in VFS streams: missing files, EBADF on closed fds,
diff --git a/test/parallel/test-vfs-stream-explicit-fd.js b/test/parallel/test-vfs-stream-explicit-fd.js
index bac86b56149..7720c0bb9f4 100644
--- a/test/parallel/test-vfs-stream-explicit-fd.js
+++ b/test/parallel/test-vfs-stream-explicit-fd.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Test createReadStream / createWriteStream with an explicit `fd` option.
diff --git a/test/parallel/test-vfs-stream-properties.js b/test/parallel/test-vfs-stream-properties.js
index 98691c4961e..174ea7415d8 100644
--- a/test/parallel/test-vfs-stream-properties.js
+++ b/test/parallel/test-vfs-stream-properties.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// VFS streams must expose bytesRead, bytesWritten, and pending.
diff --git a/test/parallel/test-vfs-stream-validation.js b/test/parallel/test-vfs-stream-validation.js
index 7e599fccf9a..dfe1017f723 100644
--- a/test/parallel/test-vfs-stream-validation.js
+++ b/test/parallel/test-vfs-stream-validation.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// VFS stream constructors must validate start/end synchronously.
diff --git a/test/parallel/test-vfs-streams.js b/test/parallel/test-vfs-streams.js
index 977834d719b..7d86a614eb0 100644
--- a/test/parallel/test-vfs-streams.js
+++ b/test/parallel/test-vfs-streams.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
const common = require('../common');
diff --git a/test/parallel/test-vfs-symlinks.js b/test/parallel/test-vfs-symlinks.js
index f251c08b6b9..c65a9ebf079 100644
--- a/test/parallel/test-vfs-symlinks.js
+++ b/test/parallel/test-vfs-symlinks.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Symlink behaviour in the default (memory) VFS:
diff --git a/test/parallel/test-vfs-truncate-negative.js b/test/parallel/test-vfs-truncate-negative.js
index d051d00de8a..44122c3f40b 100644
--- a/test/parallel/test-vfs-truncate-negative.js
+++ b/test/parallel/test-vfs-truncate-negative.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// truncateSync with negative length must clamp to 0, not throw.
diff --git a/test/parallel/test-vfs-utimes.js b/test/parallel/test-vfs-utimes.js
index 861b59aaff9..7189bffb40e 100644
--- a/test/parallel/test-vfs-utimes.js
+++ b/test/parallel/test-vfs-utimes.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// utimes / lutimes accept Date instances, numeric seconds, strings,
diff --git a/test/parallel/test-vfs-virtual-file-handle.js b/test/parallel/test-vfs-virtual-file-handle.js
index 21f93709ab6..587c7f26fff 100644
--- a/test/parallel/test-vfs-virtual-file-handle.js
+++ b/test/parallel/test-vfs-virtual-file-handle.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs --expose-internals
+// Flags: --disable-warning=ExperimentalWarning --expose-internals
'use strict';
// Cover the VirtualFileHandle base class — all primitives must throw
diff --git a/test/parallel/test-vfs-virtual-provider.js b/test/parallel/test-vfs-virtual-provider.js
index 467f860bc8c..7c734405d10 100644
--- a/test/parallel/test-vfs-virtual-provider.js
+++ b/test/parallel/test-vfs-virtual-provider.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Exercise the VirtualProvider base class — its capability flags,
diff --git a/test/parallel/test-vfs-watch-abort-signal.js b/test/parallel/test-vfs-watch-abort-signal.js
index 4ceb9f78744..d335c33caa0 100644
--- a/test/parallel/test-vfs-watch-abort-signal.js
+++ b/test/parallel/test-vfs-watch-abort-signal.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// AbortSignal handling for watch() and promises.watch().
diff --git a/test/parallel/test-vfs-watch-directory.js b/test/parallel/test-vfs-watch-directory.js
index cc6e6ce2d36..4252dfc8b22 100644
--- a/test/parallel/test-vfs-watch-directory.js
+++ b/test/parallel/test-vfs-watch-directory.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Tests for VFS directory watching:
diff --git a/test/parallel/test-vfs-watch-encoding.js b/test/parallel/test-vfs-watch-encoding.js
index 2a5cc652cbc..aae59741c4b 100644
--- a/test/parallel/test-vfs-watch-encoding.js
+++ b/test/parallel/test-vfs-watch-encoding.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Buffer encoding for watch(): filename arrives as a Buffer.
diff --git a/test/parallel/test-vfs-watch-promises.js b/test/parallel/test-vfs-watch-promises.js
index 9de8ebd4022..0dbf7e83229 100644
--- a/test/parallel/test-vfs-watch-promises.js
+++ b/test/parallel/test-vfs-watch-promises.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// promises.watch() returns an async iterable. Cover its event queue,
diff --git a/test/parallel/test-vfs-watch-recursive.js b/test/parallel/test-vfs-watch-recursive.js
index 9f678db3069..a96aaed0242 100644
--- a/test/parallel/test-vfs-watch-recursive.js
+++ b/test/parallel/test-vfs-watch-recursive.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Recursive directory watching: descendant changes trigger events.
diff --git a/test/parallel/test-vfs-watch.js b/test/parallel/test-vfs-watch.js
index ed5d36d1d06..3ce9493f884 100644
--- a/test/parallel/test-vfs-watch.js
+++ b/test/parallel/test-vfs-watch.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Tests for VFS watch() on a single file: change detection, listener
diff --git a/test/parallel/test-vfs-watchfile.js b/test/parallel/test-vfs-watchfile.js
index 6a6e08e5f92..836f02bea63 100644
--- a/test/parallel/test-vfs-watchfile.js
+++ b/test/parallel/test-vfs-watchfile.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Tests for VFS watchFile/unwatchFile.
diff --git a/test/parallel/test-vfs-write-options.js b/test/parallel/test-vfs-write-options.js
index 476d00801bd..29a0713ccaf 100644
--- a/test/parallel/test-vfs-write-options.js
+++ b/test/parallel/test-vfs-write-options.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// writeFile / appendFile accept explicit { flag, mode } options.
diff --git a/test/parallel/test-vfs-zip-provider-commit.js b/test/parallel/test-vfs-zip-provider-commit.js
index 6a2874be4ee..80e71db46f8 100644
--- a/test/parallel/test-vfs-zip-provider-commit.js
+++ b/test/parallel/test-vfs-zip-provider-commit.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// A ZipProvider handle commits its content to the archive when it is closed.
diff --git a/test/parallel/test-vfs-zip-provider-dispose.js b/test/parallel/test-vfs-zip-provider-dispose.js
index b93ed914a70..58331d158a4 100644
--- a/test/parallel/test-vfs-zip-provider-dispose.js
+++ b/test/parallel/test-vfs-zip-provider-dispose.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Exercises ZipProvider's Symbol.dispose / Symbol.asyncDispose aliases:
diff --git a/test/parallel/test-vfs-zip-provider-handle.js b/test/parallel/test-vfs-zip-provider-handle.js
index 4263864e241..44d0505acb8 100644
--- a/test/parallel/test-vfs-zip-provider-handle.js
+++ b/test/parallel/test-vfs-zip-provider-handle.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Additional ZipProvider coverage beyond test-vfs-zip-provider.js:
diff --git a/test/parallel/test-vfs-zip-provider-readdir-recursive.js b/test/parallel/test-vfs-zip-provider-readdir-recursive.js
index 553ae98cfcd..5239eeae083 100644
--- a/test/parallel/test-vfs-zip-provider-readdir-recursive.js
+++ b/test/parallel/test-vfs-zip-provider-readdir-recursive.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// A recursive readdir() of a ZipProvider lists every member below the
diff --git a/test/parallel/test-vfs-zip-provider.js b/test/parallel/test-vfs-zip-provider.js
index c93c8721453..63982092229 100644
--- a/test/parallel/test-vfs-zip-provider.js
+++ b/test/parallel/test-vfs-zip-provider.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Exercises ZipProvider (node:vfs backed by node:zlib's ZipBuffer/
diff --git a/test/parallel/test-zlib-zip-vfs.js b/test/parallel/test-zlib-zip-vfs.js
index 213dcad0f28..dd85e7251b4 100644
--- a/test/parallel/test-zlib-zip-vfs.js
+++ b/test/parallel/test-zlib-zip-vfs.js
@@ -1,4 +1,4 @@
-// Flags: --experimental-vfs
+// Flags: --disable-warning=ExperimentalWarning
'use strict';
// Exercises the node:zlib ZipFile read/write surface over a node:vfs virtual