Skip to content

Instantly share code, notes, and snippets.

@BrianLitwin
Last active March 12, 2019 20:22
Show Gist options
  • Save BrianLitwin/76b49ddae517cf7e878043539aec624a to your computer and use it in GitHub Desktop.
Save BrianLitwin/76b49ddae517cf7e878043539aec624a to your computer and use it in GitHub Desktop.

if (repoId != null) return die(std, "multiple repository IDs provided");

would it increase clarity to call these paramters: loadPagerankGraph, runPagerankGraph and savePagerankGraph ?

how could this fail?

how would you break this?

errors if load returns stats: REPO_NOT_LOADED

makePagerank Command

  • takes three functions as arguments
  • loops through the arguments provided, checking for '--help' (prints usage)
  • run pagerank if correct command is provided
  • then you load the graph
  • handles result, saves on "SUCCESS"

const mock = jest.fn(); const command = makePagerankCommand(loader, mockPagerankRunner, mock); => call this 'mockSaver`

"errors if the repoId was not loaded first" "prints a message if the repo is not loaded"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment