Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a sonar tutorial #137

Open
serut opened this issue Sep 20, 2016 · 1 comment
Open

Add a sonar tutorial #137

serut opened this issue Sep 20, 2016 · 1 comment

Comments

@serut
Copy link

serut commented Sep 20, 2016

It would be great to help people to setup nyc with sonar.

Here is my setup:

npm install xunit-file --save-dev

add the following to the mocha command:

--reporter xunit-file --reporter-options file='./report/test-all.xml'

This is what I use (typescript + webpack + react) :

nyc mocha-webpack --webpack-config webpack.coverage.config.js \"(tests|web_modules)/**/*.test.\\?(ts|tsx)\" --require source-map-support/register --reporter mocha-sonar-reporter --reporter-options file='./coverage/TEST-xunit.xml'

webpack config:


  // Enable sourcemaps for debugging webpack's output.
  devtool: "cheap-module-source-map",
  module: {
    loaders: [
      {
        test: /\.tsx{0,1}?$/,
        exclude: [/node_modules/, /json/],
        loaders: ['istanbul-instrumenter', "babel-loader", "ts-loader"]
      }
    ]
  }

  plugins: [
    // Allow to define React as a global variable for JSX/TSX.
    new webpack.ProvidePlugin({"React": "react",}),
  ]
@bcoe
Copy link
Member

bcoe commented Sep 25, 2016

@serut I don't do a ton of front-end coding these days, so I'm not the best person to write this tutorial -- would love the help if you wanted to help contribute:

https://github.com/istanbuljs/istanbuljs.github.io

@JaKXz JaKXz transferred this issue from istanbuljs/nyc Jan 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants