回调函数被读取为对象?

我正在尝试做一些量角器测试,并决定创建一个通用功能来测试多个测试用例

at the top of my todo-spec.js I have the following function:

function bomImport(filePath, numLines, alternates, rejected)
{
  it('should import a BOM with ' + String(numLines) + ' lines.', function()
  {
    var customerSelection = browser.driver.findElement(by.css('select[formcontrolname="customer"]')).findElement(by.css('option[value="AMX|NOVI|MI"]'));
    var projectName = browser.driver.findElement(by.css('input[formcontrolname="project"'));
    var quoteType = browser.driver.findElement(by.css('select[formcontrolname="type')).findElement(by.css('option[value="bid"'));
    var quantities = browser.driver.findElement(by.css('input[formcontrolname="quantitie0"'))
    var fileName = browser.driver.findElement(by.css('input[type="file"'));
    var importedLines = browser.driver.findElement(by.id('imported'));

    customerSelection.click();
    projectName.sendKeys("import Test");
    quoteType.click();
    quantities.sendKeys('100');
    fileName.sendKeys(filePath);
    browser.waitForAngular();

    expect(importedLines.getText()).toEqual(numLines)
  })

  it('should reject ' + String(rejected) + ' lines.', function()
  {
    var rejectedLines = browser.driver.findElement(by.id('rejected'));

    expect(rejectedLines.getText()).toEqual(rejected);
  })

  it('should have ' + String(alternates) + ' alternate components', function() 
  {
    var numAlternates = browser.driver.findElement(by.id('alternates'));

    expect(numAlternates.getText()).toEqual(alternates)
  })

}

and I am implementing the function like this also in todo-spec.js

describe('BOM Import Test 1', bomImport('T1 2599B BOM Reformat 4.xlsx', '1050', '1049','0')); 

当量角器到达这一点时,错误消息

describe expects a function argument; received [object Undefined]

但是据我了解,我正在传递一个函数?所以我对错误有点困惑