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

Add exhaustive unit testing for each adapter and the main BikeTagClient methods #88

Open
KenEucker opened this issue Nov 21, 2021 · 2 comments
Labels
help wanted Extra attention is needed someday-maybe

Comments

@KenEucker
Copy link
Owner

Testing for each of the adapters was added when created but each is entirely commented out. Of the 39 tests that run on behalf of the current jest config, only the client.test.ts file contains any real testing. All of the testing files have moved to the test folder and out of the src folder.

The test/src folder should be the unit tests that cover the ts file. There is an e2e folder in there as well, which

We're not aiming for 100% coverage. I think, for each of the adapter methods we should have tests covering the required params to complete the request and the responses provided by the method.

Reports are to be added to this ticket as testing progresses towards the BikeTag v2.0 release.

@KenEucker
Copy link
Owner Author

KenEucker commented Nov 21, 2021

So, since this project was built on top of the node-imgur package's next branch, the tests are still those that were written for the imgur API. I left the tests in there to learn from the pattern employed. You'll see that the files in this folder don't match up with the BikeTag API:
https://github.com/KenEucker/biketag-api/tree/production/test/mocks/handlers

Those will need to be renamed/rewritten as the methods of the BikeTagClient class and should include tests for each adapter's implemented method. Those methods are:

  • config
  • getGame
  • queueTagImage
  • getQueue
  • getTag
  • getTags
  • updateTag
  • uploadTagImage
  • importTag
  • deleteTag
  • deleteTags
  • getPlayer
  • getAmbassador
  • getSetting

@KenEucker
Copy link
Owner Author

KenEucker commented Nov 29, 2021

As of 1.11.0, the biketag api will throw an error if an invoked method is not implemented for a given client adapter. Because of these errors, we can add tests for each unimplemented method, and then tests will fail as those methods become implemented (requiring more testing). Error reporting in failed tests that verify a method is not implemented should state that "new tests need to be written to replace this now invalid test".

KenEucker added a commit that referenced this issue Nov 30, 2021
also includes some cleanup and minor updates found in test discovery
@KenEucker KenEucker added help wanted Extra attention is needed someday-maybe labels Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed someday-maybe
Projects
None yet
Development

No branches or pull requests

1 participant