CCALI / a2jdat

This repo hosts the distributable production version of the A2J Document Assembly Tool (DAT). The document assembly tool is an optional piece of software used for producing pdf documents at the end of A2J Author Guided Interviews.
https://www.a2jauthor.org
Other
3 stars 1 forks source link

Fix ECONNREFUSED error when running the /api/preview tests #100

Open chasenlehara opened 2 years ago

chasenlehara commented 2 years ago

Slack thread for context: https://cali.slack.com/archives/C069V9TTN/p1639757244068800

Steps to reproduce:

  1. Remove the .skip from a preview test, e.g. https://github.com/CCALI/a2jdat/blob/6f598245364941ac387620864f5858d79ae8ec7d/test/routes/preview.js#L29-L30

  2. Run the tests (npm test)

Expected results: tests would pass.

Actual results: all the tests pass except this preview test.

Note that if you skip this test, then the preview test will pass: https://github.com/CCALI/a2jdat/blob/6f598245364941ac387620864f5858d79ae8ec7d/test/routes/assemble.js#L26-L42

What I observed with @tobiasnteireho is that when a document is rendered with SSR for assembly or preview, it works the first time, but subsequent calls fail because the server has been torn down.

I am happy to pair with whoever picks this up so I can help them reproduce it.