Skip to content

Commit

Permalink
add test for render with enableRequestReportTimeout but no req.option…
Browse files Browse the repository at this point in the history
…s.timeout specified
  • Loading branch information
bjrmatos committed Mar 29, 2023
1 parent 3a71d73 commit 70910b8
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions packages/jsreport-core/test/render/renderTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,35 @@ describe('render (single timeout per request as req.options.timeout)', () => {
timeoutTests(true)
})

describe('render with enableRequestReportTimeout', () => {
let reporter

beforeEach(() => {
const opts = { enableRequestReportTimeout: true, discover: false, reportTimeoutMargin: 0 }

reporter = core(opts)

reporter.use(core.tests.listeners())
return reporter.init()
})

afterEach(() => {
if (reporter) {
return reporter.close()
}
})

it('should render normally even if req.options.timeout is not specified', async () => {
return reporter.render({
template: {
engine: 'none',
content: 'foo',
recipe: 'html'
}
}).should.not.be.rejected()
})
})

function timeoutTests (asReqOption = false) {
let reporter
const reportTimeout = 1000
Expand Down

0 comments on commit 70910b8

Please sign in to comment.