Class SourceMapTestUtil

java.lang.Object
com.vaadin.flow.testutil.SourceMapTestUtil

public final class SourceMapTestUtil extends Object
Helpers for the tests that check the sourcemaps a frontend build emits.

A build plugin that rewrites a module or a chunk has to chain its sourcemap onto the one the bundler already has, otherwise the emitted map ends up without the original sources and the browser cannot map the bundle back to them.

  • Method Details

    • assertSourceMapUsable

      public static List<String> assertSourceMapUsable(String name, String sourceMap)
      Asserts that the given sourcemap can be used to map the bundle it belongs to back to the files it was built from.
      Parameters:
      name - the name of the sourcemap, used in the assertion messages
      sourceMap - the contents of the sourcemap file
      Returns:
      the original files the sourcemap refers to