Open jonahsnider opened 5 years ago
This sounds great, but wouldn't this require a test bot to be submitted to each list? Having a bot listed in every list sounds like something that would be difficult to maintain. I'll be cleaning up the code some more this weekend, and doing some manual testing.
Just as food for thought on test lib, we use Mocha & Chai (chai-http) for testing BotBlock itself (web rendering & API).
but wouldn't this require a test bot to be submitted to each list?
You misunderstood what I meant.
In your code, when you send a request to BotBlock, the request would be intercepted by a testing library (I used moxios
) and allow you to compare the sent request to what should have been sent,.
You can relatively easily have unit testing for API requests by using libraries like Sinon. I created a package very similar to this and it had unit testing for nearly every request variation, with around 90% test coverage.
The test code is open source, here's an example file that uses moxios, sinon, and TAP for botlist.space.