Skip to content

Commit

Permalink
test:debugger auto resume - promise to async/await
Browse files Browse the repository at this point in the history
  • Loading branch information
samyuktaprabhu committed Sep 16, 2022
1 parent 5d92ddc commit 13916a1
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 36 deletions.
36 changes: 0 additions & 36 deletions test/sequential/test-debugger-auto-resume.js

This file was deleted.

37 changes: 37 additions & 0 deletions test/sequential/test-debugger-auto-resume.mjs
@@ -0,0 +1,37 @@
import { skipIfInspectorDisabled } from '../common/index.mjs';

skipIfInspectorDisabled();

import { path as _path } from '../common/fixtures.mjs';
import startCLI from '../common/debugger.mjs';
import { addLibraryPath } from '../common/shared-lib-util.mjs';

import { deepStrictEqual, strictEqual } from 'assert';
import { relative } from 'path';

addLibraryPath(process.env);

// Auto-resume on start if the environment variable is defined.
{
const scriptFullPath = _path('debugger', 'break.js');
const script = relative(process.cwd(), scriptFullPath);

const env = {
...process.env,
};
env.NODE_INSPECT_RESUME_ON_START = '1';

const cli = startCLI([script], [], {
env,
});

{
await cli.waitForInitialBreak();
deepStrictEqual(cli.breakInfo, {
filename: script,
line: 10,
});
const code = await cli.quit();
strictEqual(code, 0);
}
}

0 comments on commit 13916a1

Please sign in to comment.