power-assert-js/power-assert

test files which are not in the 'test' dir than seems won't work

kaidiren opened this issue · 5 comments

good one:

image

bad one:

image

test with same file: power.js

var assert = require('assert');

describe('Array', function(){
    beforeEach(function(){
        this.ary = [1,2,3];
    });
    describe('#indexOf()', function(){
        it('should return index when the value is present', function(){
            var zero = 0, two = 2;
            assert(this.ary.indexOf(zero) === two);
        });
    });
});

I have one project that the test files are not in the test dir .

please help me. thanks!

node version 4.4.0

intelli-espower-loader": "^1.0.1",

"mocha": "^3.2.0",

azu commented

Maybe, You could require power-assert instead of assert and resolve this issue.

var assert = require('assert');

should be

var assert = require('power-assert');
twada commented

@kaidiren Thank you for your question. If you are using intelli-espower-loader and having tests in directory other than test, you have to set test directory in your package.json explicitly.

@twada thanks!

twada commented

I close this issue since this issue seems to be fixed by my answer. Please feel free to reopen this issue if you have any problems.