Skip to content

Commit 475d7a8

Browse files
chore: add NUT debug logging
1 parent ae3a9fa commit 475d7a8

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

test/.eslintrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = {
1212
rules: {
1313
// Allow assert style expressions. i.e. expect(true).to.be.true
1414
'no-unused-expressions': 'off',
15-
15+
'no-console': 'off',
1616
// It is common for tests to stub out method.
1717

1818
// Return types are defined by the source code. Allows for quick overwrites.

test/commands/api/request/rest.nut.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,16 @@ describe('api:request:rest NUT', () => {
3535
describe('std out', () => {
3636
it('get result in json format', () => {
3737
const result = execCmd("api request rest 'services/data/v56.0/limits'").shellOutput.stdout;
38+
console.warn('res', result);
3839
// make sure we got a JSON object back
3940
expect(Object.keys(JSON.parse(result) as Record<string, unknown>)).to.have.length;
4041
});
4142

4243
it('should pass headers', () => {
4344
const result = execCmd("api request rest 'services/data/v56.0/limits' -H 'Accept: application/xml'").shellOutput
4445
.stdout;
46+
console.log('res', result);
47+
4548
// the headers will change this to xml
4649
expect(result.startsWith('<?xml version="1.0" encoding="UTF-8"?><LimitsSnapshot>')).to.be.true;
4750
});
@@ -51,6 +54,8 @@ describe('api:request:rest NUT', () => {
5154
it('get result in json format', () => {
5255
const result = execCmd("api request rest 'services/data/v56.0/limits' --stream-to-file out.txt").shellOutput
5356
.stdout;
57+
console.log('res', result);
58+
5459
expect(result.trim()).to.equal('File saved to out.txt');
5560

5661
const content = readFileSync(join(testSession.project.dir, 'out.txt'), 'utf-8');
@@ -62,6 +67,8 @@ describe('api:request:rest NUT', () => {
6267
const result = execCmd(
6368
"api request rest 'services/data/v56.0/limits' -H 'Accept: application/xml' --stream-to-file out.txt"
6469
).shellOutput.stdout;
70+
console.log('res', result);
71+
6572
expect(result.trim()).to.equal('File saved to out.txt');
6673

6774
const content = readFileSync(join(testSession.project.dir, 'out.txt'), 'utf-8');

0 commit comments

Comments
 (0)