Skip to content

Commit 34175f8

Browse files
committed
add dns
1 parent 27e119d commit 34175f8

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

integration/test/ParseDistTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ for (const fileName of ['parse.js', 'parse.min.js']) {
44
beforeAll(async () => {
55
const browser = await puppeteer.launch();
66
page = await browser.newPage();
7-
await page.goto(`http://127.0.0.1:1337/${fileName}`);
7+
await page.goto(`http://localhost:1337/${fileName}`);
88
});
99
describe(`Parse Dist Test ${fileName}`, () => {
1010
it('can save an object', async () => {

integration/test/ParseLiveQueryTest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe('Parse LiveQuery', () => {
5353
it('can subscribe to query with null connect fields', async done => {
5454
const client = new Parse.LiveQueryClient({
5555
applicationId: 'integration',
56-
serverURL: 'ws://127.0.0.1:1337',
56+
serverURL: 'ws://localhost:1337',
5757
javascriptKey: null,
5858
masterKey: null,
5959
sessionToken: null,

integration/test/clear.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ const Parse = require('../../node');
88
* @returns {Promise} A promise that is resolved when database is deleted.
99
*/
1010
module.exports = function (fast = true) {
11-
return Parse._ajax('GET', `http://127.0.0.1:1337/clear/${fast}`, '');
11+
return Parse._ajax('GET', `http://localhost:1337/clear/${fast}`, '');
1212
};

integration/test/helper.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@ 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';
16-
const serverURL = 'http://127.0.0.1:1337/parse';
22+
const serverURL = 'http://localhost:1337/parse';
1723
let didChangeConfiguration = false;
1824

1925
/*
@@ -33,7 +39,7 @@ const twitterAuthData = {
3339
};
3440

3541
const defaultConfiguration = {
36-
databaseURI: 'mongodb://127.0.0.1:27017/integration',
42+
databaseURI: 'mongodb://localhost:27017/integration',
3743
appId: 'integration',
3844
masterKey: 'notsosecret',
3945
serverURL,
@@ -130,7 +136,7 @@ const reconfigureServer = (changedConfiguration = {}) => {
130136
<script>
131137
(function() {
132138
Parse.initialize('integration');
133-
Parse.serverURL = 'http://127.0.0.1:1337/parse';
139+
Parse.serverURL = 'http://localhost:1337/parse';
134140
})();
135141
</script>
136142
</head>

0 commit comments

Comments
 (0)