2017-02-27 6 views
0

複数のテキストフィールドを入力し、ドロップダウンからオプションを選択する私のシナリオではステップがあります。私は、入力されたテキストと選択されたオプションがそれぞれ正しいことを主張したいと思います。キュウリ - 分度器複数の期待と通知

expect(action1).to.eventually.have.string('some text').and.notify(callback); 
expect(action2).to.eventually.have.string('some text').and.notify(callback); 
expect(action3).to.eventually.have.string('some text').and.notify(callback); 

私が遭遇してる問題は、第一又は第二が予想される場合アクションは任意の次のアクションが偽陽性につながる実行されませなり、その後渡すということです。

私は理想的には、最後に期待するまでコールバックなしで通知する手段を探しています。誰でもこれがどのように行われるのか知っていますか?

答えて

0

私は最初に気付かなかった別のStackOverflow質問に答えを見つけました。

How does one use Q.all with chai-as-promised?

それは次のようになりQを使用して:

var Q = require('q'); 
var chai = require('chai'); 
var expect = chai.expect; 
var should = chai.should(); 

Q.all([ 
    expect(action1).to.eventually.have.string('some text'), 
    expect(action2).to.eventually.have.string('some text'), 
    expect(action3).to.eventually.have.string('some text'), 
]).should.notify(callback);