souramoo / commentoplusplus

Commento with out of the box patches and updates to add useful features and fixes. Also with one-click deploy to Heroku so you can get up and running fast.
MIT License
391 stars 63 forks source link

API: revive unit-tests #93

Closed olof-nord closed 2 years ago

olof-nord commented 2 years ago

There are currently nine unit tests in three files which do not compile.

Before we can automatically run tests within a CI, we need to add the missing arguments to the tests.

$ GO111MODULE=on make test               
GO111MODULE=on go mod vendor
go test -v .
# gitlab.com/commento/commento/api [gitlab.com/commento/commento/api.test]
./comment_approve_test.go:15:27: not enough arguments in call to commentApprove
    have (string)
    want (string, string)
./comment_approve_test.go:29:27: not enough arguments in call to commentApprove
    have (string)
    want (string, string)
./comment_delete_test.go:15:38: not enough arguments in call to commentDelete
    have (string, string)
    want (string, string, string, string)
./comment_delete_test.go:31:30: not enough arguments in call to commentDelete
    have (string, string)
    want (string, string, string, string)
./comment_vote_test.go:17:33: not enough arguments in call to commentVote
    have (string, string, number)
    want (string, string, int, string)
./comment_vote_test.go:27:33: not enough arguments in call to commentVote
    have (string, string, number)
    want (string, string, int, string)
./comment_vote_test.go:32:33: not enough arguments in call to commentVote
    have (string, string, number)
    want (string, string, int, string)
./comment_vote_test.go:42:33: not enough arguments in call to commentVote
    have (string, string, number)
    want (string, string, int, string)
./comment_vote_test.go:52:33: not enough arguments in call to commentVote
    have (string, string, number)
    want (string, string, int, string)
FAIL    gitlab.com/commento/commento/api [build failed]
FAIL
make: *** [Makefile:37: test-go] Error 2
souramoo commented 2 years ago

Thanks for spotting this! Fixed in 379e474! :)