Skip to content

Commit

Permalink
test: Introduce debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Mar 17, 2022
1 parent ccc3b7d commit 9f6f6bb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/unit/lib/plugins/aws/invoke-local/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const sinon = require('sinon');
const path = require('path');
const EventEmitter = require('events');
const fse = require('fs-extra');
const log = require('log').get('serverless:test');
const proxyquire = require('proxyquire');
const overrideEnv = require('process-utils/override-env');
const AwsProvider = require('../../../../../../lib/plugins/aws/provider');
Expand Down Expand Up @@ -997,7 +998,14 @@ describe('test/unit/lib/plugins/aws/invokeLocal/index.test.js', () => {
},
},
});
const outputAsJson = JSON.parse(response.output);
const outputAsJson = (() => {
try {
return JSON.parse(response.output);
} catch (error) {
log.error('Unexpected response output: %s', response.output);
throw error;
}
})();
responseBody = JSON.parse(outputAsJson.body);
});

Expand Down

0 comments on commit 9f6f6bb

Please sign in to comment.