• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3// This tests that module.runMain can be monkey patched using --require.
4// TODO(joyeecheung): This probably should be deprecated.
5
6require('../common');
7const { path } = require('../common/fixtures');
8const assert = require('assert');
9const { spawnSync } = require('child_process');
10
11const child = spawnSync(process.execPath, [
12  '--require',
13  path('monkey-patch-run-main.js'),
14  path('semicolon.js'),
15]);
16
17assert.strictEqual(child.status, 0);
18assert(child.stdout.toString().includes('runMain is monkey patched!'));
19