Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept url in config #67

Closed
wants to merge 2 commits into from
Closed

Accept url in config #67

wants to merge 2 commits into from

Conversation

deadcoder0904
Copy link

Closes #61

@@ -13,6 +13,10 @@ test('v4 with impossible timeout', async t => {
t.false(await isOnline({timeout: 1}));
});

test('check url', async t => {
t.true(await isOnline({url: 'https://google.com'}));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're not actually testing the url option here as the IP checks are faster. You need to mock those out.

@@ -5,7 +5,7 @@ const pAny = require('p-any');
const pTimeout = require('p-timeout');

const appleCheck = async options => {
const {body} = await got('http://captive.apple.com/hotspot-detect.html', {
const {body} = await got(options.url, {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You cannot just change the URL here. Look at the surrounding code. (https://github.com/sindresorhus/is-online/pull/67/files#diff-168726dbe96b3ce427e7fedce31bb0bcR15)

@sindresorhus
Copy link
Owner

This is not what was agreed on in #61:

I think we should bring it back, but only try the those hostnames if all the 3 current checks fail.

@deadcoder0904
Copy link
Author

Sorry then, probably have no idea how to do it. Both testing & url config :(

@deadcoder0904 deadcoder0904 deleted the accept-url-in-config branch November 17, 2019 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is it possible to pass URL in config?
2 participants