I would like to dynamically generate it blocks based on the values returned by a promise. Something along these lines:

describe('Main Page', function() {
    var rowNumber=event.script1(); //---Getting promise return value from other.js file

    describe('my loopy test', function() {
        rowNumber.then(function(result) {
            console.log(result.row) //printing row number: 2
            let myData = parseInt(result.row) //passed to integer

            console.log(myData) ; //printing row numbe r:2
            for (let i = 0; i < myData; i++) {
                it('gets ' + myData + 'loopy', function () {

This does not work now, jasmine does not generate it tests here. How should I approach the problem?

  • What are you actually asking?
    – Kate Paulk
    Commented Sep 15, 2017 at 11:32
  • @KatePaulk edited and added my understanding of the question based on what I understand is happening and what I saw people asking in similar situations. Hope this is what the OP meant.
    – alecxe
    Commented Sep 15, 2017 at 13:13


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.