Skip to content

Commit

Permalink
fix(Runtime): Use Node v14 (LLC-1483) (#846)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Uses Node v14 instead of v12
  • Loading branch information
crazy-grizzly authored Apr 25, 2022
1 parent f1448bb commit 033221e
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 24 deletions.
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ machine:
jobs:
build:
docker:
- image: node:12
- image: node:14
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASSWORD
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
key: dist-{{ .Branch }}-{{ .Revision }}
test-local:
docker:
- image: node:12
- image: node:14
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASSWORD
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
- run: yarn codecov
test-s3:
docker:
- image: node:12
- image: node:14
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASSWORD
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
- run: yarn codecov
test-azure:
docker:
- image: node:12
- image: node:14
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASSWORD
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
- run: yarn codecov
test-google:
docker:
- image: node:12
- image: node:14
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASSWORD
Expand Down Expand Up @@ -204,7 +204,7 @@ jobs:
- run: yarn codecov
release:
docker:
- image: node:12
- image: node:14
auth:
username: $DOCKERHUB_USERNAME
password: $DOCKERHUB_PASSWORD
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:12
FROM node:14
ENV NPM_CONFIG_LOGLEVEL warn
WORKDIR /usr/src/app

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: '3.6'
services:
mongo:
command: --bind_ip_all --replSet rs0
container_name: ll_mongo
image: mongo:4.4
command: --bind_ip_all --replSet rs0
ports:
- 27017:27017
volumes:
Expand Down
37 changes: 23 additions & 14 deletions src/apps/statements/expressPresenter/tests/getParts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const partToTestPart = async (part: Part) => {
const getTestParts = async (stream: ReadableStream, boundary: string) => {
const actualParts = await getParts(stream, boundary);
const testPartsPromises = actualParts.map(partToTestPart);
const testParts = await Promise.all(testPartsPromises);
return testParts;

return Promise.all(testPartsPromises);
};

const headersToString = (headers: { readonly [key: string]: string }): string => {
Expand Down Expand Up @@ -180,19 +180,28 @@ describe('expressPresenter/utils/getParts', () => {

it('should throw error when there is an error in the stream', async () => {
const stream = new ReadableStream();
const error = new Error();
try {
stream.push('hello');
stream.emit('error', error);
} catch {
// Do nothing.
}
stream._read = () => true;

const error = new Error('Test stream error');
const errorEmitDelayMs = 50;

try {
await getTestParts(stream, TEST_BOUNDARY);
/* istanbul ignore next */
assert.fail('Expected error to be thrown.');
} catch {
// Do nothing.
await Promise.all([
getTestParts(stream, TEST_BOUNDARY),
new Promise<void>((resolve) => {
setTimeout(() => {
stream.emit('error', error);

resolve();
}, errorEmitDelayMs);
}),
]);
} catch (e) {
assert.deepEqual(e, error);

return;
}

assert.fail(`Error "${error.message}" should have thrown`);
});
});
3 changes: 1 addition & 2 deletions src/apps/statements/utils/getStreamData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ export default async (stream: ReadableStream): Promise<string> => {
});
});

const trimmedData = trim(data, trimmedChars);
return trimmedData;
return trim(data, trimmedChars);
};

0 comments on commit 033221e

Please sign in to comment.