Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chasenlehara opened this issue Dec 17, 2021 · 0 comments
Open

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

chasenlehara opened this issue Dec 17, 2021 · 0 comments

Comments

@chasenlehara
Copy link

chasenlehara commented Dec 17, 2021

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

Steps to reproduce:

  1. Remove the .skip from a preview test, e.g.

    // TODO: this test is skipped due to the issue described in https://github.com/CCALI/a2jdat/issues/100
    it.skip('previews basic templates correctly', function (done) {

  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:

it('assembles basic templates correctly', function (done) {
// Set a longer timeout, otherwise the PDF generation will fail
this.timeout(5000)
const fileDataUrl = path.join(__dirname, '..', 'data', 'DEV', 'guides', 'Guide1262')
request(app)
.post('/api/assemble')
.send({
answers: '{}',
fileDataUrl
})
.expect(200)
.end(function (err) {
if (err) return done(err)
done()
})
})

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant