Skip to content

Commit

Permalink
fix: PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
j-luong committed Mar 12, 2024
1 parent 5f2f266 commit 9abc1df
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/lib/request/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ export async function makeRequest(
payload: Payload,
): Promise<{ res: needle.NeedleResponse; body: any }> {
const { method, url, data, options } = setupRequest(payload);
// debug(data);

return new Promise((resolve, reject) => {
needle.request(method, url, data, options, (err, res, respBody) => {
Expand Down
12 changes: 2 additions & 10 deletions test/jest/acceptance/cli-json-output.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,12 @@ describe('test --json', () => {

const {
code,
stdout,
stdoutBuffer,
stderr,
stderrBuffer,
} = await runSnykCLI(`test -d --json`, {
} = await runSnykCLI(`test --json`, {
cwd: project.path(),
env: { ...env, DEBUG: '*' },
env,
bufferOutput: true,
});
console.log('****', 'stderr ****\n', stderr, '\n');
console.log('****', 'stderrBuf ****\n', stderrBuffer, '\n');
console.log('****', 'stdout ****\n', stdout, '\n');
console.log('****', 'stdoutBuf ****\n', stdoutBuffer, '\n');
console.log('****', 'code ****\n', code, '\n');

expect(code).toEqual(1);
expect(stdoutBuffer).toBeDefined();
Expand Down
3 changes: 2 additions & 1 deletion test/jest/util/runCommand.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { SpawnOptionsWithoutStdio } from 'child_process';
import { spawn } from 'cross-spawn';
// const debug = require('debug')('acceptance-test:runCommand');

type RunCommandResult = {
code: number;
Expand All @@ -10,6 +9,8 @@ type RunCommandResult = {
stderrBuffer?: Buffer;
};

// bufferOutput sets the RunCommandResult stdoutBuffer and stderrBuffer
// useful if the stdout or stderr string output is too large for the v8 engine
type RunCommandOptions = SpawnOptionsWithoutStdio & { bufferOutput?: boolean };

const runCommand = (
Expand Down

0 comments on commit 9abc1df

Please sign in to comment.