You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a simple README that explains how to use the library, run the tests, high level architecture (handlers/parsers) etc.
Consider mocking/stubbing in tests to avoid doing real requests against real web servers (look up "flaky tests")
In checkForWebServer function if any response is returned, it is always returned by some kind of a web server
Reserve different test/check functions for specific web servers and services (Cloudflare etc.)
Tips
Mocha file watcher can be used to run tests every time the source files change
async can be used in tests (it("does a thing", async () => { const result = await doAThing(); ... }))
Early returns are a great way to simplify a function with complex return paths
Consider returning booleans or objects ({ ok: true, threatScore: 0.1 } on success and { ok: false, reason: "error_reason" } on error) instead of integers, as they are more explicit to the reader and forces the function caller to check the result
Open questions
How to parse arbitrary whois responses, @jviide will come back to this
Extra curricular activities
Set up GitHub actions for running tests after each push
Use axios to download the xyz's fingerprints.json on initialization to keep it up-to-date
Whiteboard
The text was updated successfully, but these errors were encountered:
Ideas
checkForWebServer
function if any response is returned, it is always returned by some kind of a web serverTips
async
can be used in tests (it("does a thing", async () => { const result = await doAThing(); ... })
){ ok: true, threatScore: 0.1 }
on success and{ ok: false, reason: "error_reason" }
on error) instead of integers, as they are more explicit to the reader and forces the function caller to check the resultOpen questions
whois
responses, @jviide will come back to thisExtra curricular activities
fingerprints.json
on initialization to keep it up-to-dateWhiteboard
The text was updated successfully, but these errors were encountered: