-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
7,022 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
dist/ | ||
lib/ | ||
dist/ | ||
node_modules/ | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/tsconfig", | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"noEmit": true | ||
}, | ||
"include": ["../../__tests__/**/*", "../../src/**/*"], | ||
"exclude": ["../../dist", "../../node_modules", "../../coverage", "*.json"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/node_modules/ | ||
/lib/ | ||
/coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
import fetch from 'node-fetch' | ||
import { getLocalIP } from '../src/utils' | ||
// import fetch from 'node-fetch' | ||
// import { getLocalIP } from '../src/utils' | ||
|
||
const { Response } = jest.requireActual('node-fetch') | ||
jest.mock('node-fetch', () => jest.fn()) | ||
// const { Response } = jest.requireActual('node-fetch') | ||
// jest.mock('node-fetch', () => jest.fn()) | ||
|
||
test('pass correctly the IP address', async () => { | ||
const mockedFetch = fetch as jest.MockedFunction<typeof fetch> | ||
mockedFetch.mockImplementationOnce(() => new Response('12.34.56.78')) | ||
// test('pass correctly the IP address', async () => { | ||
// const mockedFetch = fetch as jest.MockedFunction<typeof fetch> | ||
// mockedFetch.mockImplementationOnce(() => new Response('12.34.56.78')) | ||
|
||
const localIP = await getLocalIP() | ||
expect(localIP).toBe('12.34.56.78') | ||
}) | ||
// const localIP = await getLocalIP() | ||
// expect(localIP).toBe('12.34.56.78') | ||
// }) | ||
|
||
// //TODO: test what happens when the connection fails | ||
|
||
//TODO: test what happens when the connection fails | ||
describe('dummy', () => { | ||
it('test', () => { | ||
console.log('Dummy test') | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.