Skip to content

Conversation

@jimmywarting
Copy link
Contributor

@jimmywarting jimmywarting commented Jan 4, 2022

Small misc quality of dev fixes too small for one PR

not sure if you didn't want any of this small fixes.
can easier be addressed if you just review and say what you didn't like about this PR so i can fix them.

  • i moved a require() to the top
  • and i used obj destructuring
  • and explicit path with extension

all so it matches the similarity of how esm are built & required to be (for easier transition to esm if that day ever comes)
any chain use of require('xyz').whatever... only makes it harder to refactor to esm at some point later, and esm require explicit path so...

  • used @typedef to import superagent.Response to not mix up with fetch response class...
  • and removed the use of self = this with arrow fn

Also wanted to convert TestAgent into a class, but you allow it to be called without new so changing it would be a breaking change... (unless you do something like this)

also thought about using some private class fields but don't know how far you are willing to go with modernization

@niftylettuce
Copy link
Collaborator

I think we could convert everything to classes and then encourage use of new where needed (we can do major semver bump)

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.

2 participants