Kava
  • Introduction
  • Comparison
  • Troubleshooting
  • Upgrade
Powered by GitBook
On this page
  • An invalid amount of arguments were specified for a Suite
  • An invalid amount of arguments were specified for a Test

Was this helpful?

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:

// 1 arguments
suite('name', function (suite) {
  suite('an immediate suite', function (suite, test) {
    test('an immediate test', function () {})
  })
})
// 2 arguments
suite('name', function (suite, test) {
  test('an immediate test', function () {})
})
// 3 arguments
suite('name', function (suite, test, done) {
  setTimeout(function () {
    test('a delayed test', function () {})
    done()
  }, 1000)
})

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:

// 0 arguments
test('an immediate test', function () {
  // completes right away
})
// 1 arguments
test('an asynchronous test', function (done) {
  setTimeout(function () {
    done()
  }, 1000)
})

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

PreviousComparisonNextUpgrade

Last updated 6 years ago

Was this helpful?