Skip to content

Commit

Permalink
DEV: add stack for asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael O'Brien committed Sep 14, 2023
1 parent 56c252a commit 7f3652a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export default class SenseLogs {
/*
Grab a stack snapshot if required
*/
if (ctx['@stack'] === true) {
if (ctx['@stack'] === true || chan == 'assert') {
try {
ctx['@stack'] = new Error('stack').stack
.split('\n')
Expand Down
1 change: 0 additions & 1 deletion test/constructor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ test('Constructor: destination, name', async() => {

test('Constructor: timestamp', async() => {
const log = new SenseLogs({name: 'test', destination: 'capture', timestamp: true})
log.info('Hello World')

let result: any = log.flush()[0]
expect(result).toMatchObject({
Expand Down

0 comments on commit 7f3652a

Please sign in to comment.