Skip to content

Commit c8ac62f

Browse files
authored
Merge branch 'alpha' into dplewis-patch-2
2 parents ed5fbf5 + f714763 commit c8ac62f

File tree

7 files changed

+49
-14
lines changed

7 files changed

+49
-14
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,26 @@ jobs:
1717
with:
1818
version: 1
1919
build:
20-
runs-on: ubuntu-18.04
20+
runs-on: ubuntu-latest
2121
timeout-minutes: 30
22-
env:
23-
MONGODB_VERSION: 3.6.9
22+
strategy:
23+
matrix:
24+
include:
25+
- name: Node 14
26+
NODE_VERSION: 14.21.1
27+
- name: Node 16
28+
NODE_VERSION: 16.18.1
29+
- name: Node 18
30+
NODE_VERSION: 18.12.1
31+
fail-fast: false
2432
steps:
2533
- name: Fix usage of insecure GitHub protocol
2634
run: sudo git config --system url."https://github".insteadOf "git://github"
2735
- uses: actions/checkout@v2
2836
- name: Use Node.js
2937
uses: actions/setup-node@v1
3038
with:
31-
node-version: 14
39+
node-version: ${{ matrix.NODE_VERSION }}
3240
- name: Cache Node.js modules
3341
uses: actions/cache@v2
3442
with:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![Snyk Badge](https://snyk.io/test/github/parse-community/Parse-SDK-JS/badge.svg)](https://snyk.io/test/github/parse-community/Parse-SDK-JS)
99
[![Coverage](http://codecov.io/github/parse-community/Parse-SDK-JS/coverage.svg?branch=alpha)](http://codecov.io/github/parse-community/Parse-SDK-JS?branch=alpha)
1010

11-
[![Node Version](https://img.shields.io/badge/nodejs-14-green.svg?logo=node.js&style=flat)](https://nodejs.org/)
11+
[![Node Version](https://img.shields.io/badge/nodejs-14,_16,_18-green.svg?logo=node.js&style=flat)](https://nodejs.org/)
1212
[![auto-release](https://img.shields.io/badge/%F0%9F%9A%80-auto--release-9e34eb.svg)](https://github.com/parse-community/parse-dashboard/releases)
1313

1414
[![npm latest version](https://img.shields.io/npm/v/parse/latest.svg)](https://www.npmjs.com/package/parse)

changelogs/CHANGELOG_alpha.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# [4.0.0-alpha.4](https://github.com/parse-community/Parse-SDK-JS/compare/4.0.0-alpha.3...4.0.0-alpha.4) (2022-12-21)
2+
3+
4+
### Features
5+
6+
* Add Node 16 and 18 support ([#1598](https://github.com/parse-community/Parse-SDK-JS/issues/1598)) ([2c79a31](https://github.com/parse-community/Parse-SDK-JS/commit/2c79a31201d569b645eea475290c9ed0266227fc))
7+
18
# [4.0.0-alpha.3](https://github.com/parse-community/Parse-SDK-JS/compare/4.0.0-alpha.2...4.0.0-alpha.3) (2022-11-18)
29

310

integration/test/helper.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ const { TestUtils } = require('parse-server');
1010
const Parse = require('../../node');
1111
const fs = require('fs');
1212
const path = require('path');
13+
const dns = require('dns');
14+
15+
// Ensure localhost resolves to ipv4 address first on node v17+
16+
if (dns.setDefaultResultOrder) {
17+
dns.setDefaultResultOrder('ipv4first');
18+
}
1319

1420
const port = 1337;
1521
const mountPath = '/parse';

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse",
3-
"version": "4.0.0-alpha.3",
3+
"version": "4.0.0-alpha.4",
44
"description": "The Parse JavaScript SDK",
55
"homepage": "https://parseplatform.org/",
66
"keywords": [

src/__tests__/LiveQueryClient-test.js

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ describe('LiveQueryClient', () => {
307307
expect(liveQueryClient.subscriptions.size).toBe(1);
308308
});
309309

310-
it('can handle WebSocket error response message', () => {
310+
it('can handle WebSocket error response message', async () => {
311311
const liveQueryClient = new LiveQueryClient({
312312
applicationId: 'applicationId',
313313
serverURL: 'ws://test',
@@ -329,13 +329,17 @@ describe('LiveQueryClient', () => {
329329
isChecked = true;
330330
expect(error).toEqual('error');
331331
});
332-
333-
liveQueryClient._handleWebSocketMessage(event);
332+
try {
333+
liveQueryClient._handleWebSocketMessage(event);
334+
await liveQueryClient.connectPromise;
335+
} catch (error) {
336+
expect(error.message).toEqual('error');
337+
}
334338

335339
expect(isChecked).toBe(true);
336340
});
337341

338-
it('can handle WebSocket error while subscribing', () => {
342+
it('can handle WebSocket error while subscribing', async () => {
339343
const liveQueryClient = new LiveQueryClient({
340344
applicationId: 'applicationId',
341345
serverURL: 'ws://test',
@@ -363,7 +367,12 @@ describe('LiveQueryClient', () => {
363367
expect(error).toEqual('error thrown');
364368
});
365369

366-
liveQueryClient._handleWebSocketMessage(event);
370+
try {
371+
liveQueryClient._handleWebSocketMessage(event);
372+
await Promise.all([subscription.connectPromise, subscription.subscribePromise, liveQueryClient.connectPromise, liveQueryClient.subscribePromise]);
373+
} catch (e) {
374+
expect(e.message).toEqual('error thrown');
375+
}
367376

368377
jest.runOnlyPendingTimers();
369378
expect(isChecked).toBe(true);
@@ -740,7 +749,7 @@ describe('LiveQueryClient', () => {
740749
liveQueryClient._handleWebSocketError(error);
741750
});
742751

743-
it('can handle WebSocket reconnect on error event', () => {
752+
it('can handle WebSocket reconnect on error event', async () => {
744753
const liveQueryClient = new LiveQueryClient({
745754
applicationId: 'applicationId',
746755
serverURL: 'ws://test',
@@ -764,7 +773,12 @@ describe('LiveQueryClient', () => {
764773
expect(error).toEqual(data.error);
765774
});
766775
const spy = jest.spyOn(liveQueryClient, '_handleReconnect');
767-
liveQueryClient._handleWebSocketMessage(event);
776+
try {
777+
liveQueryClient._handleWebSocketMessage(event);
778+
await liveQueryClient.connectPromise;
779+
} catch (e) {
780+
expect(e.message).toBe('Additional properties not allowed');
781+
}
768782

769783
expect(isChecked).toBe(true);
770784
expect(liveQueryClient._handleReconnect).toHaveBeenCalledTimes(1);

0 commit comments

Comments
 (0)