Expect that you will not be fully working in Jasmine.

I am running a jasine test with a protractor and I'm not sure how the wait works. I expect jasmine to fail me, as I obviously failed. This is not true.

I am using grunt-protractor-runner 1.2.1 which uses Jasmine2.

I have this test case:

var validateObject = function(object) {

    expect('1.0').toEqual('1.0'); //no error
    //expect('1.1').toEqual('1.0'); //error

    console.log(object['property']); //1.0
    console.log(object['property'] === '1.0'); //true
    console.log(typeof object['property']); //string

    /*PROBLEM STARTS HERE*/
    expect(object['property']).toEqual('1.0'); //no error
    expect(object['property']).toEqual('1.1'); //no error
};

var readSomething = function(done) {
    fs.createReadStream('folder + fileName')
        .pipe(operation.Parse())
        .on('entry', function(file) {
            validateObject(file);
        .on('end', function(){
            done();
        });
};

describe('test this', function () {
    it("stuff", function (done) {
        /*lots of stuff happening*/

        expect('asd').toEqual('asd'); //no error
        //expect('asd').toEqual('asds'); //error
        readSomething(done);
    });
});

Any idea what I'm missing here? Am I missing some asynchronous functions? One thing I noticed when I comment on "done ()", a few seconds after everything has already happened, the logs start showing me one of them for each iteration that calls validateObject:

A Jasmine spec timed out. Resetting the WebDriver Control Flow.
The last active task was:
unknown
F

Failures:
1) ----Bulkd Process----- testing the whole bulk process
  Message:
    Expected '1.0' to equal '1.1'.

console.logs . , , done . ? () async?

"should". . , .

+4

All Articles