Jest-preset-angular: regression in zone patch in 8.1.1 with it.each as tagged template literal

Created on 13 Mar 2020  ·  3Comments  ·  Source: thymikee/jest-preset-angular

The fix released in 8.1.1 didn't consider usage of it.each as tagged template literal and currently it breaks with

 FAIL  src/app/app.component.spec.ts (12.248s)
  ● AppComponent › encountered a declaration exception

    TypeError: row.map is not a function

      113 |     foo  | bar
      114 |     ${1} | ${2}
    > 115 |   `('it.each should work with table as a tagged template literal', ({foo, bar}) => {
          |    ^
      116 |     expect(foo).toBe(1);
      117 |     expect(bar).toBe(2);
      118 |   });

      at node_modules/jest-preset-angular/build/zone-patch/index.js:137:73
          at Array.map (<anonymous>)
      at src/app/app.component.spec.ts:115:4
      at Object.<anonymous> (src/app/app.component.spec.ts:9:1)

This usage works in 8.1.0. I'll submit a PR with regression test in example app it's here: #360

Bug

Most helpful comment

@ahnpnl , I created a refactor PR to simplify the logic and handle all the cases, it should work for all the known cases for now. And @bgoscinski thank you for the test cases.

All 3 comments

cc @JiaLiPassion could you please take a look ?

@ahnpnl , sure , will check it now.

@ahnpnl , I created a refactor PR to simplify the logic and handle all the cases, it should work for all the known cases for now. And @bgoscinski thank you for the test cases.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Nxt3 picture Nxt3  ·  4Comments

jesusbotella picture jesusbotella  ·  8Comments

maxencefrenette picture maxencefrenette  ·  8Comments

ArielGueta picture ArielGueta  ·  4Comments

thekip picture thekip  ·  6Comments