Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-12599

ui-extension build reports wrong line numbers in stack traces of failing tests

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Done
    • 13.0.0
    • 14.2.0, 100.3.0
    • channel-manager
    • None
    • 1
    • Puma Sprint 233

    Description

      When a test is failing in the ui-extension build, Jest shows a stack trace for the failing call. The line number mentioned in that stack trace is wrong. Jest seems to report the line number in the transpiled code instead of the 'real' line number in the TypeScript file. This makes it hard to pinpoint which line of code makes a test fail.

      Steps to reproduce:

      1. Change ui-extension.ts in a way that breaks a test. For example, invert the check whether the provided callback is a function (i.e. change !== to ===)
      1. Run npm test

      Jest will output a stack trace per failing test. For example:

      at Function.Object.<anonymous>.UiExtension.register (src/ui-extension.ts:517:19)
            at Object.<anonymous> (src/ui-extension.spec.ts:24:17)

      The reported line number (517) in ui-extension.ts is wrong (it only consists of ~65 lines). Instead, Jest should report the actual line number in the TypeScript file.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mdenburger Mathijs den Burger (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: