command.executableSubcommand.inspect.test.js
This file
Path
tests/command.executableSubcommand.inspect.test.js
56 lines · 2.4 KiB · JavaScript
Last changed by
Update dependencies and rewrite tests (#1167)John Geebefore adoptiond736ff7
History of this fileTake it
The walk stopped after 200 commits: lines older than 9499d47 point at it.
Merge pull request #1060 from shadowspawn/feature/changelog-2.20.1Tomoaki Abebefore adoption9499d47
lines 1–2why, one step back1const childProcess = require('child_process');2const path = require('path');Update dependencies and rewrite tests (#1167)John Geebefore adoptiond736ff7
line 3why, one step back3const util = require('util');Merge pull request #1060 from shadowspawn/feature/changelog-2.20.1Tomoaki Abebefore adoption9499d47
line 4why, one step back4Update dependencies and rewrite tests (#1167)John Geebefore adoptiond736ff7
lines 5–6why, one step back5const execFileAsync = util.promisify(childProcess.execFile);6Merge pull request #1060 from shadowspawn/feature/changelog-2.20.1Tomoaki Abebefore adoption9499d47
lines 7–11why, one step back7// Test the special handling for --inspect to increment fixed debug port numbers.8// If we reuse port we can get conflicts because port not released fast enough.910const inspectCommand = path.join(__dirname, './fixtures', 'inspect.js');11Update dependencies and rewrite tests (#1167)John Geebefore adoptiond736ff7
lines 12–14why, one step back12test('when execArgv empty then spawn execArgs empty', async() => {13 const { stdout } = await execFileAsync('node', [inspectCommand, 'sub']);14 expect(stdout).toBe('[]\n');Merge pull request #1060 from shadowspawn/feature/changelog-2.20.1Tomoaki Abebefore adoption9499d47
lines 15–16why, one step back15});16Update dependencies and rewrite tests (#1167)John Geebefore adoptiond736ff7
lines 17–19why, one step back17test('when execArgv --harmony then spawn execArgs --harmony', async() => {18 const { stdout } = await execFileAsync('node', ['--harmony', inspectCommand, 'sub']);19 expect(stdout).toBe("[ '--harmony' ]\n");Merge pull request #1060 from shadowspawn/feature/changelog-2.20.1Tomoaki Abebefore adoption9499d47
lines 20–22why, one step back20});2122// --inspect defaults to 127.0.0.1:9229, port should be incrementedUpdate dependencies and rewrite tests (#1167)John Geebefore adoptiond736ff7
lines 23–25why, one step back23test('when execArgv --inspect then spawn execArgs using port 9230', async() => {24 const { stdout } = await execFileAsync('node', ['--inspect', inspectCommand, 'sub']);25 expect(stdout).toBe("[ '--inspect=127.0.0.1:9230' ]\n");Merge pull request #1060 from shadowspawn/feature/changelog-2.20.1Tomoaki Abebefore adoption9499d47
lines 26–28why, one step back26});2728// custom portUpdate dependencies and rewrite tests (#1167)John Geebefore adoptiond736ff7
lines 29–31why, one step back29test('when execArgv --inspect=9240 then spawn execArgs using port 9241', async() => {30 const { stdout } = await execFileAsync('node', ['--inspect=9240', inspectCommand, 'sub']);31 expect(stdout).toBe("[ '--inspect=127.0.0.1:9241' ]\n");Merge pull request #1060 from shadowspawn/feature/changelog-2.20.1Tomoaki Abebefore adoption9499d47
lines 32–34why, one step back32});3334// zero is special, random portUpdate dependencies and rewrite tests (#1167)John Geebefore adoptiond736ff7
lines 35–37why, one step back35test('when execArgv --inspect=0 then spawn execArgs --inspect=0', async() => {36 const { stdout } = await execFileAsync('node', ['--inspect=0', inspectCommand, 'sub']);37 expect(stdout).toBe("[ '--inspect=0' ]\n");Merge pull request #1060 from shadowspawn/feature/changelog-2.20.1Tomoaki Abebefore adoption9499d47
lines 38–40why, one step back38});3940// ip addressUpdate dependencies and rewrite tests (#1167)John Geebefore adoptiond736ff7
lines 41–43why, one step back41test('when execArgv --inspect=127.0.0.1:9250 then spawn execArgs --inspect=127.0.0.1:9251', async() => {42 const { stdout } = await execFileAsync('node', ['--inspect=127.0.0.1:9250', inspectCommand, 'sub']);43 expect(stdout).toBe("[ '--inspect=127.0.0.1:9251' ]\n");Merge pull request #1060 from shadowspawn/feature/changelog-2.20.1Tomoaki Abebefore adoption9499d47
lines 44–46why, one step back44});4546// localhostUpdate dependencies and rewrite tests (#1167)John Geebefore adoptiond736ff7
lines 47–49why, one step back47test('when execArgv --inspect=localhost:9260 then spawn execArgs --inspect=localhost:9261', async() => {48 const { stdout } = await execFileAsync('node', ['--inspect=localhost:9260', inspectCommand, 'sub']);49 expect(stdout).toBe("[ '--inspect=localhost:9261' ]\n");Merge pull request #1060 from shadowspawn/feature/changelog-2.20.1Tomoaki Abebefore adoption9499d47
lines 50–52why, one step back50});5152// --inspect-port, just test most likely formatUpdate dependencies and rewrite tests (#1167)John Geebefore adoptiond736ff7
lines 53–55why, one step back53test('when execArgv --inspect-port=9270 then spawn execArgs --inspect-port=127.0.0.1:9271', async() => {54 const { stdout } = await execFileAsync('node', ['--inspect-port=9270', inspectCommand, 'sub']);55 expect(stdout).toBe("[ '--inspect-port=127.0.0.1:9271' ]\n");Merge pull request #1060 from shadowspawn/feature/changelog-2.20.1Tomoaki Abebefore adoption9499d47
line 56why, one step back56});