Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected behavior for __tests__ directory #20

Open
Flaise opened this issue Oct 4, 2015 · 1 comment
Open

Unexpected behavior for __tests__ directory #20

Flaise opened this issue Oct 4, 2015 · 1 comment

Comments

@Flaise
Copy link

Flaise commented Oct 4, 2015

Test project:
https://github.com/Flaise/power-assert-test

Environment:

  • Ubuntu 14.04.3 LTS
  • node 4.1.1
  • npm 3.3.5
  • mocha 2.3.3
  • power-assert 1.1.0
  • espower-babel 3.3.0

Output:

$ npm run test-works

> power-assert-test@0.0.0-test.0 test-works .../power-assert-test
> ./node_modules/mocha/bin/mocha --compilers js:espower-babel/guess



  assert
    1) should not give the same output as a regular assertion


  0 passing (30ms)
  1 failing

  1) assert should not give the same output as a regular assertion:

      AssertionError:   # test/test.js:8

  assert(a.value === b.value)
         | |     |   | |     
         | |     |   | 4     
         | |     |   Object{value:4}
         | 3     false       
         Object{value:3}     

  [number] b.value
  => 4
  [number] a.value
  => 3

      + expected - actual

      -false
      +true

      at decoratedAssert (node_modules/empower/lib/decorate.js:42:30)
      at powerAssert (node_modules/empower/index.js:58:32)
      at Context.<anonymous> (test/test.js:8:9)

That's what your readme files say is supposed to happen.

$ npm run test-broken

> power-assert-test@0.0.0-test.0 test-broken .../power-assert-test
> ./node_modules/mocha/bin/mocha --compilers js:espower-babel/guess __tests__



  assert
    1) should not give the same output as a regular assertion


  0 passing (15ms)
  1 failing

  1) assert should not give the same output as a regular assertion:

      AssertionError: false == true
      + expected - actual

      -false
      +true

      at decoratedAssert (node_modules/empower/lib/decorate.js:44:25)
      at powerAssert (node_modules/empower/index.js:58:32)
      at Context.<anonymous> (__tests__/test.js:8:9)

This isn't as advertised. I don't see why it wouldn't give the same output as the other test configuration.

@twada
Copy link
Member

twada commented Oct 5, 2015

Hi @Flaise , thank you for reporting.

test-broken run does not produce power-assert output because __tests__ dir is not recognized as test dir by default. To configure test dir, please see If your tests are not in test dir section of README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants