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

Workshop 11/22/24 #1

Open
jukkakoskinen opened this issue Nov 22, 2024 · 0 comments
Open

Workshop 11/22/24 #1

jukkakoskinen opened this issue Nov 22, 2024 · 0 comments
Assignees

Comments

@jukkakoskinen
Copy link

jukkakoskinen commented Nov 22, 2024

Ideas

  • 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

image

@kinggreedy kinggreedy self-assigned this Dec 3, 2024
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

No branches or pull requests

2 participants