title: Cannot use Jasmine's 'It' block inside an async-promise function
body: <p>I'm having an issue with using IT block inside a loop. The loop basically comes from the returned Promise, an <strong>exceljs</strong> module that reads data from an excel file.</p>
  
  <p>Here' is the promise function.</p>
  
  <pre><code>var excelJs = require('exceljs');
  var Excel = browser.params.Excel;
  
  this.createProfile = function() {
          var arr = [];
          return new Promise(function(fulfill, reject){
          var workbook = new excelJs.Workbook();
  
          workbook.xlsx.readFile(Excel.filePath).then(function(){    
              worksheet = workbook.getWorksheet(1);
              worksheet.eachRow({includeEmpty: true}, function(row, rowNumber)
                  try {
                      if (rowNumber != 1) {
                          arr.push(row.values);
                          fulfill(arr);
                      }
                  } catch(ex){reject(ex);}
                }, reject);
              });
          });
  };
  </code></pre>
  
  <p>And here is how I did to call inside a spec file.</p>
  
  <pre><code>describe('Bulk Purchase', function(){
  
          var cp = createProfile();
          cp.then(function(data){
              for (var i in data){
                  it('Automate School Supplies Purchase', function(done){
                      console.log('Ballpen: ' + data[i][1]);
                      console.log('Notebook: ' + data[i][2]); //etc
                      done();
                  });
              }
          })
      });
  </code></pre>
  
  <p>The spec will display the expected values if I <strong>removed</strong> the <strong>IT</strong> block from the code. Can somebody enlighten me on why would a simple <strong>IT</strong> block inside a promise would not work? Any help will be appreciated thank you :)</p>
  
  <p>I have a workaround on this, if I converted the Excel to JSON, and require the json file and do the forEach, then I can easily do the data-driven automated test. But I would prefer not to move from other source file to fulfill my original approach.</p>
  
  <pre><code>// where I used xlsx-to-json npm to convert my excel to json
  var jsonData = require('path to converted excel to json file');
  
  jsonData.forEach(function(data){
     it('Automate School Supplies Purchase', function(){
        console.log(data.Ballpen);
        console.log(data.Notebook); //etc
     })
  });
  </code></pre>