moll / js-must

An assertion library for JavaScript and Node.js with a friendly BDD syntax (awesome.must.be.true()). It ships with many expressive matchers and is test runner and framework agnostic. Follows RFC 2119 with its use of MUST. Good stuff and well tested.
Other
336 stars 35 forks source link

Test suite failing #1

Closed Bartvds closed 11 years ago

Bartvds commented 11 years ago

Using the global mocha 1.13.0 on Windows on Node 10.17.0

 673 passing (295ms)
  78 failing

  1) Must.prototype.a AssertionError must have correct stack trace:
     AssertionError: must have test at top
      at Context.<anonymous> (D:\project\must\js-must\test\assertions_test.js:25:9)
      at Test.Runnable.run (C:\Users\Bart\AppData\Roaming\npm\node_modules\mocha\lib\runnable.js:211:32)
... //more stack

If it is a Windows issue I might look into it later (need to do other stuff)

FYI: If you need a Windows VM: they are free here: http://www.modern.ie/en-us/virtualization-tools#downloads (Vagrant/Chef for Windows isn't there yet)

moll commented 11 years ago

Thank you! I've already got a feeling I know what's the culprit here — I was naïvely asserting the stack trace had forward slashes for file paths.

I'll fire a VM up to make sure, but I'll bet if you replace / with \ in assertions_test.js#L25 the tests will pass.

moll commented 11 years ago

Just adding that this should affect tests only, not the functioning of the library itself.

Bartvds commented 11 years ago

Likely, but how do you know? Does the test pass? :smile:

moll commented 11 years ago

Well, to be perfectly pedantic, I had a feeling I know. I might not really know, but the feeling is there! :-P I'll give the VM a try in the morning, but would you mind testing that feeling out? :)

Bartvds commented 11 years ago

Sure, commit some and I can run it and tweak a bit if needed.

moll commented 11 years ago

Oh, I just thought if you could try the fix yourself, but here's the fixed line that I had in mind:

assert(stack[1].match(/[\/\\]test[\/\\]/), "must have test at top")
Bartvds commented 11 years ago

Closed per #2

moll commented 11 years ago

Thanks again! I just published v0.1.338 to NPM with this fix, too.