| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c96d701 commit 517e715
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,24 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + const common = require('../common'); | ||
| 3 | + const assert = require('assert'); | ||
| 4 | + const cp = require('child_process'); | ||
| 5 | + | ||
| 6 | + if (common.isWindows) { | ||
| 7 | + common.skip('Backtraces unimplemented on Windows.'); | ||
| 8 | + return; | ||
| 9 | + } | ||
| 10 | + | ||
| 11 | + if (process.argv[2] === 'child') { | ||
| 12 | + process.abort(); | ||
| 13 | + } else { | ||
| 14 | + const child = cp.spawnSync(`${process.execPath}`, [`${__filename}`, 'child']); | ||
| 15 | + const frames = | ||
| 16 | + child.stderr.toString().trimRight().split('\n').map((s) => s.trim()); | ||
| 17 | + | ||
| 18 | + assert.strictEqual(child.stdout.toString(), ''); | ||
| 19 | + assert.ok(frames.length > 0); | ||
| 20 | + // All frames should start with a frame number. | ||
| 21 | + assert.ok(frames.every((frame, index) => frame.startsWith(`${index + 1}:`))); | ||
| 22 | + // At least some of the frames should include the binary name. | ||
| 23 | + assert.ok(frames.some((frame) => frame.includes(`[${process.execPath}]`))); | ||
| 24 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments