Kava
Search…
Troubleshooting

An invalid amount of arguments were specified for a Suite

Suite initialisers accept only one, two, or three arguments, as shown by the following snippets:
one-arguments.js
two-arguments.js
three-arguments.js
1
// 1 arguments
2
suite('name', function (suite) {
3
suite('an immediate suite', function (suite, test) {
4
test('an immediate test', function () {})
5
})
6
})
Copied!
1
// 2 arguments
2
suite('name', function (suite, test) {
3
test('an immediate test', function () {})
4
})
Copied!
1
// 3 arguments
2
suite('name', function (suite, test, done) {
3
setTimeout(function () {
4
test('a delayed test', function () {})
5
done()
6
}, 1000)
7
})
Copied!
This is to ensure a suite is not confused with a test.
Resolving this error involves checking your logic to ensure that you actually want to use a Suite:
  • if you do want to use a suite, then update the specified arguments to a combination mentioned above
  • if you don't want to use a suite, then you may want to use a test instead

An invalid amount of arguments were specified for a Test

Tests only accept zero or one arguments, as shown by the following snippets:
zero-arguments.js
one-arguments.js
1
// 0 arguments
2
test('an immediate test', function () {
3
// completes right away
4
})
Copied!
1
// 1 arguments
2
test('an asynchronous test', function (done) {
3
setTimeout(function () {
4
done()
5
}, 1000)
6
})
Copied!
This is to ensure a test is not confused with a suite.
Resolving this error involves checking your logic to ensure that you actually want to use a Suite:
  • if you do want to use a test, then update the specified arguments to a combination mentioned above
  • if you don't want to use a test, then you may want to use a suite instead
Last modified 3yr ago