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

test: handle errors in zipStreamToFiles() #553

Merged

Conversation

alxndrsn
Copy link
Contributor

@alxndrsn alxndrsn marked this pull request as ready for review July 29, 2022 09:31
@@ -12,7 +12,9 @@ describe('.zip attachments streaming', () => {
{ row: { instanceId: 'subone', name: 'secondfile.ext', content: 'this is my second file' } },
{ row: { instanceId: 'subtwo', name: 'thirdfile.ext', content: 'this is my third file' } }
]);
zipStreamToFiles(zipStreamFromParts(streamAttachments(inStream)), (result) => {
zipStreamToFiles(zipStreamFromParts(streamAttachments(inStream)), (err, result) => {
if(err) return done(err);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't lint test files at the moment, but I think the linter requires a space between if and (. I don't think that should block merging, but maybe that's all the more reason to try to get #545 merged soon.

zipfile.close();
} else {
entries.forEach((entry) => {
result.filenames.push(entry.fileName);
zipfile.openReadStream(entry, (_, resultStream) => {
resultStream.pipe(streamTest.toText((_, contents) => {
zipfile.openReadStream(entry, (err, resultStream) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just another small linting thing, I think the linter would complain about the variable shadowing here.

@matthew-white matthew-white merged commit a3a07f6 into getodk:master Jul 29, 2022
alxndrsn added a commit to alxndrsn/odk-central-backend that referenced this pull request Aug 3, 2022
Co-authored-by: alxndrsn <alxndrsn>
matthew-white pushed a commit that referenced this pull request Sep 15, 2022
Co-authored-by: alxndrsn <alxndrsn>
(cherry picked from commit a3a07f6)
ktuite added a commit that referenced this pull request Dec 1, 2023
ktuite added a commit that referenced this pull request Dec 7, 2023
* Tests showing failure

* Separated entity-specific submission parsing code

* Test demonstrating issue #522

* A test demonstrating issue #553

* Forcing /meta/entity field to be type structure

* Tidying up tests to be clearer to read in the future

* Tests to start looking at impact of empty structure entity field

* More tests of odata

* Removed console.log from exploratory test to make circleci happy

* Small final test changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants