Skip to content

Commit 98ca075

Browse files
authored
test: don't rely on localhost being an alias for 127.0.0.1 in tests (#1200)
1 parent 25c0dbb commit 98ca075

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/library-legacy/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"test:lint": "eslint src/ test/ --ext .js,.ts",
4848
"test:lint:fix": "eslint src/ test/ --fix --ext .js,.ts",
4949
"test:live": "TEST_LIVE=1 pnpm run test:unit:node",
50-
"test:live-with-test-validator": "start-server-and-test '$HOME/.local/share/solana/install/active_release/bin/solana-test-validator --reset --quiet' http://localhost:8899/health test:live",
50+
"test:live-with-test-validator": "start-server-and-test '$HOME/.local/share/solana/install/active_release/bin/solana-test-validator --reset --quiet' http://127.0.0.1:8899/health test:live",
5151
"test:prettier": "prettier --check '{,{src,test}/**/}*.{j,t}s'",
5252
"test:prettier:fix": "prettier --write '{,{src,test}/**/}*.{j,t}s'",
5353
"test:typecheck": "tsc --noEmit",

packages/library-legacy/test/url.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ declare var process: {
1212
};
1313

1414
export const url = process.env.TEST_LIVE
15-
? 'http://localhost:8899/'
16-
: 'http://localhost:9999/';
15+
? 'http://127.0.0.1:8899/'
16+
: 'http://127.0.0.1:9999/';
1717

1818
export const wsUrl = process.env.TEST_LIVE
19-
? 'ws://localhost:8900/'
20-
: 'ws://localhost:9999/';
19+
? 'ws://127.0.0.1:8900/'
20+
: 'ws://127.0.0.1:9999/';
2121

2222
export const nodeVersion = Number(process.version.split('.')[0]);
2323

packages/library-legacy/test/websocket.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ if (process.env.TEST_LIVE) {
7676
});
7777

7878
it('connect by websocket endpoint from options', async () => {
79-
let connection = new Connection('http://localhost', {
79+
let connection = new Connection('http://127.0.0.1', {
8080
wsEndpoint: wsUrl,
8181
});
8282

0 commit comments

Comments
 (0)