Skip to content

Commit 033221e

Browse files
fix(Runtime): Use Node v14 (LLC-1483) (#846)
BREAKING CHANGE: Uses Node v14 instead of v12
1 parent f1448bb commit 033221e

File tree

5 files changed

+32
-24
lines changed

5 files changed

+32
-24
lines changed

.circleci/config.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ machine:
77
jobs:
88
build:
99
docker:
10-
- image: node:12
10+
- image: node:14
1111
auth:
1212
username: $DOCKERHUB_USERNAME
1313
password: $DOCKERHUB_PASSWORD
@@ -41,7 +41,7 @@ jobs:
4141
key: dist-{{ .Branch }}-{{ .Revision }}
4242
test-local:
4343
docker:
44-
- image: node:12
44+
- image: node:14
4545
auth:
4646
username: $DOCKERHUB_USERNAME
4747
password: $DOCKERHUB_PASSWORD
@@ -77,7 +77,7 @@ jobs:
7777
- run: yarn codecov
7878
test-s3:
7979
docker:
80-
- image: node:12
80+
- image: node:14
8181
auth:
8282
username: $DOCKERHUB_USERNAME
8383
password: $DOCKERHUB_PASSWORD
@@ -122,7 +122,7 @@ jobs:
122122
- run: yarn codecov
123123
test-azure:
124124
docker:
125-
- image: node:12
125+
- image: node:14
126126
auth:
127127
username: $DOCKERHUB_USERNAME
128128
password: $DOCKERHUB_PASSWORD
@@ -164,7 +164,7 @@ jobs:
164164
- run: yarn codecov
165165
test-google:
166166
docker:
167-
- image: node:12
167+
- image: node:14
168168
auth:
169169
username: $DOCKERHUB_USERNAME
170170
password: $DOCKERHUB_PASSWORD
@@ -204,7 +204,7 @@ jobs:
204204
- run: yarn codecov
205205
release:
206206
docker:
207-
- image: node:12
207+
- image: node:14
208208
auth:
209209
username: $DOCKERHUB_USERNAME
210210
password: $DOCKERHUB_PASSWORD

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:12
1+
FROM node:14
22
ENV NPM_CONFIG_LOGLEVEL warn
33
WORKDIR /usr/src/app
44

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
version: '3.6'
22
services:
33
mongo:
4+
command: --bind_ip_all --replSet rs0
45
container_name: ll_mongo
56
image: mongo:4.4
6-
command: --bind_ip_all --replSet rs0
77
ports:
88
- 27017:27017
99
volumes:

src/apps/statements/expressPresenter/tests/getParts.test.ts

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ const partToTestPart = async (part: Part) => {
3232
const getTestParts = async (stream: ReadableStream, boundary: string) => {
3333
const actualParts = await getParts(stream, boundary);
3434
const testPartsPromises = actualParts.map(partToTestPart);
35-
const testParts = await Promise.all(testPartsPromises);
36-
return testParts;
35+
36+
return Promise.all(testPartsPromises);
3737
};
3838

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

181181
it('should throw error when there is an error in the stream', async () => {
182182
const stream = new ReadableStream();
183-
const error = new Error();
184-
try {
185-
stream.push('hello');
186-
stream.emit('error', error);
187-
} catch {
188-
// Do nothing.
189-
}
183+
stream._read = () => true;
184+
185+
const error = new Error('Test stream error');
186+
const errorEmitDelayMs = 50;
187+
190188
try {
191-
await getTestParts(stream, TEST_BOUNDARY);
192-
/* istanbul ignore next */
193-
assert.fail('Expected error to be thrown.');
194-
} catch {
195-
// Do nothing.
189+
await Promise.all([
190+
getTestParts(stream, TEST_BOUNDARY),
191+
new Promise<void>((resolve) => {
192+
setTimeout(() => {
193+
stream.emit('error', error);
194+
195+
resolve();
196+
}, errorEmitDelayMs);
197+
}),
198+
]);
199+
} catch (e) {
200+
assert.deepEqual(e, error);
201+
202+
return;
196203
}
204+
205+
assert.fail(`Error "${error.message}" should have thrown`);
197206
});
198207
});

src/apps/statements/utils/getStreamData.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@ export default async (stream: ReadableStream): Promise<string> => {
2121
});
2222
});
2323

24-
const trimmedData = trim(data, trimmedChars);
25-
return trimmedData;
24+
return trim(data, trimmedChars);
2625
};

0 commit comments

Comments
 (0)