lunarmodules / busted

Elegant Lua unit testing.
https://lunarmodules.github.io/busted/
MIT License
1.4k stars 185 forks source link

Unable to specify repeat via configuration file #624

Closed danlamanna closed 4 years ago

danlamanna commented 4 years ago

Quoting the documentation of "Predefined Busted Tasks":

You can create a .busted file in the root, which is automatically loaded if it exists. ... You can add any argument available in the CLI (listed above), using the long name (use verbose = true, not v = true).

This doesn't appear to be true since the --repeat flag uses a reserved word in Lua. Is there any way of specifying that tests should repeat from the configuration file?

FWIW, my motivation is something like this:

-- .busted
return {
  exhaustive = {
    repeat = 5,
    shuffle = true,
  },
}

Which aptly results in:

failed loading config file `.busted`: .busted:3: unexpected symbol near 'repeat'
Tieske commented 4 years ago

try this:

-- .busted
return {
  exhaustive = {
    ["repeat"] = 5,
    shuffle = true,
  },
}
danlamanna commented 4 years ago

Thanks for the basic lua lesson! Sorry for the noise.