mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 07:27:22 +01:00
efb908409e
This commit ensures that the WASI module cannot be require()'ed without a CLI flag while the module is still experimental. This fixes a regression from https://github.com/nodejs/node/pull/30778. PR-URL: https://github.com/nodejs/node/pull/30963 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
10 lines
273 B
JavaScript
10 lines
273 B
JavaScript
'use strict';
|
|
// This test verifies that the WASI module cannot be require()'ed without a
|
|
// CLI flag while it is still experimental.
|
|
require('../common');
|
|
const assert = require('assert');
|
|
|
|
assert.throws(() => {
|
|
require('wasi');
|
|
}, /^Error: Cannot find module 'wasi'/);
|