You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I have tests written in multiple languages, such as Moonscript and Lua, the getTrace of one loader might get applied to a test of another language. I am able to reproduce the issue with two test files.
Steps to reproduce
Let's take the following tests as example:
-- test/arithmetic_spec.moon
it "Adds two numbers",->assert.are.equal 5,2+3
Note the second line. The file name passed to getTrace is that of the Moonscript test file, but the info object actually belongs to the Lua file.
Expected behaviour
Please correct me if I'm wrong, but shouldn't the getTrace from the Moonscript loader only apply to Moonscript tests? In the case of Moonscript it does not seem to corrupt the Lua result, but it could mess up results in other loaders. I first noticed this weird behaviour when I was trying to write a Fennel loader and the Lua test results were getting messed up.
Other notes
I was able to track down the problem to the function busted.context.parent. For some reason it returns the Moonscript (or Fennel) test as the parent of the Lua test.
The file names seem to matter, or at least their alphabetical ordering does
The text was updated successfully, but these errors were encountered:
If I have tests written in multiple languages, such as Moonscript and Lua, the
getTrace
of one loader might get applied to a test of another language. I am able to reproduce the issue with two test files.Steps to reproduce
Let's take the following tests as example:
I now run busted in the root directory of the project.
Everything looks good, right? Let's hack a little log into
busted/modules/files/moonscript.lua
.The printed output is
Note the second line. The file name passed to
getTrace
is that of the Moonscript test file, but theinfo
object actually belongs to the Lua file.Expected behaviour
Please correct me if I'm wrong, but shouldn't the
getTrace
from the Moonscript loader only apply to Moonscript tests? In the case of Moonscript it does not seem to corrupt the Lua result, but it could mess up results in other loaders. I first noticed this weird behaviour when I was trying to write a Fennel loader and the Lua test results were getting messed up.Other notes
busted.context.parent
. For some reason it returns the Moonscript (or Fennel) test as the parent of the Lua test.The text was updated successfully, but these errors were encountered: