jeffrifwald / babel-istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
144 stars 23 forks source link

babel-istanbul not CSP compatibel #86

Open msteller-connyun opened 5 years ago

msteller-connyun commented 5 years ago

Hey,

as soon I add the istanbul plugin to my babel configuration

      {
        test: /\.js$/,
        include: [/node_modules\/*\/src/, /src/],
        use: {
          loader: 'babel-loader',
           ...
            cacheDirectory: true,
            env: {
              test: {
                plugins: ['istanbul',]
              }
            }
          }
        }
      },

A new Function is added to the code:

  var global = new Function("return this")()

which violates our CSP rules.