Invalid Chai property: push. Did you mean "is"?

Skip to first unread message

Greg Mackey

Dec 31, 2019, 10:17:13 AM12/31/19
to Chai.js
I am receiving the error 'Invalid Chai property: push. Did you mean "is"?' in my console associated with a before each that calls a factory to build an elastic search body. It appears to be failing while using push to load strings into an array. Any help would be appreciated.

    //Before Tests - Create an Elastic Search Body
    before((done=> {
   const searchParametersElasticContactSearchFactory = new ElasticContactSearchFactory();
        //isApproved: true,
        isDeleted: false,

      searchBody =;

Console Output:
 1) Advanced Search Service: @odata
       "before all" hook in "Advanced Search Service: @odata":
     Error: Invalid Chai property: push. Did you mean "is"?
      at Object.proxyGetter [as get] (node_modules\chai\lib\chai\utils\proxify.js:75:17)
      at C:\git\advanced-search-service\AdvancedSearchService.Mocha\node_modules\@val\vcr-common\elastic\elastic-field-filter.js:336:28
      at Array.forEach (<anonymous>)
      at MultiFieldFilter.equal (node_modules\@val\vcr-common\elastic\elastic-field-filter.js:335:20)
      at (node_modules\@val\vcr-common\elastic\ElasticContactSearchFactory.js:115:78)
      at Context.<anonymous> (test\advanced-search-service.elasticAuth.ts:89:37)
      at C:\git\advanced-search-service\AdvancedSearchService.Mocha\test\advanced-search-service.elasticAuth.ts:69:7-service.elasticAuth.ts:69:7
      at processTicksAndRejections (internal/process/task_queues.js:93:5)

at C:\git\advanced-search-service\AdvancedSearchService.Mocha\node_modules\@val\vcr-common\elastic\elastic-field-filter.js:336:28:

           values.forEach(function (fvalue) {
                    simple_query_string: Object.assign({
                        query: fvalue,
                        fields: _this.fields,
                        default_operator: "and"
                    }, options)

  "dependencies": {

Greg Mackey

Jan 8, 2020, 1:04:51 PM1/8/20
to Chai.js
Chai overwrites the should property in the elastic search factory. Looks like I have to avoid loading or calling the should assertion.
Reply all
Reply to author
0 new messages