Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Problem

When scanning code generated by Angular 8, almost all the methods reported more than once to sealights causing lower coverage and more quality risks.

Cause

Angular 8 changed their defaults and generates multiple bundled version of the code. For example esm5, esm2015 etc.
They are essentially the same code just in a different format, and then along with the source maps point back to the same code in the original source files.
This in turn creates the duplicate entries in Sealights as they are scanned and reported.

Solutions

Change the Angular 8 configuration to generate only 1 type

This can be done for instance by updating the browserslist value

Update the .slignore file to ignore all the files you don't want

Setting the .slignore with the something similar to the following, depending on the structure of the folders and files:

**/esm2015or*-es2015.*

When you want to deploy more than one type

If you want to deploy more than one type which means you need the Sealights agent to instrument more than one, then you will need to split the build scan and instrumentation commands.

For scanning the code, you will not use the --instrumentForBrowsers option, as in: Using Node.js Agents - Scanning a build
This should be done on only one of the folders.

For instrumenting the code, you will use the --instrumentForBrowsers as in SeaLights Node.js agent - Scanning and Instrumentation of a Front-End app, but you will also specify the --instrumentationOnly flag so that a new build scan will not be performed
This should be done on all the folders you want to deploy and capture coverage for.

  • No labels