Commit 5c169805 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

doc: fix markdown formatting

parent ff7c8642
Loading
Loading
Loading
Loading
Loading
+68 −73
Original line number Diff line number Diff line
@@ -100,7 +100,6 @@ the Angular template expects the following in your `karma.conf.js`:
    },
    ```
    :warning: in case of multiple angular projects in the workspace, each project shall produce its coverage report in `reports/ng-coverage-<projectName>.cobertura.xml` (it can be in sub-folders but must follow the file name pattern).

3. Additionally, if using SonarQube, you may also want to generate [LCOV report](https://docs.sonarqube.org/latest/analysis/test-coverage/javascript-typescript-test-coverage/):
    ```js
    coverageReporter: {
@@ -169,7 +168,9 @@ Additionally, if using **SonarQube**, you may also want to generate [SonarQube g
    ```

#### 2. Using Jest

##### Unit Tests reports

To be able to use Jest instead Karma, you first have to install some jest packages.
Then you have to create a dedicated jest config file, and to modify your angular.json and tsconfig.spec.json files to set Jest as test builder.

@@ -177,7 +178,6 @@ Then you have to create a dedicated jest config file, and to modify your angular
    ```shell
    npm install jest jest-preset-angular jest-junit @types/jest @angular-builders/jest --save-dev
    ```

2. Create the file `jest.config.js`, and add the following lines:
    ```js
    module.exports = {
@@ -193,9 +193,7 @@ Then you have to create a dedicated jest config file, and to modify your angular
      globalSetup: 'jest-preset-angular/global-setup',
    };
    ```
  
3. Open the `angular.json` file. Replace the test builder with jest, and convert "inlineStyleLanguage" option to array instead string:

    ```js
    "test": {
    // REPLACE: "builder": "@angular-devkit/build-angular:karma",
@@ -206,7 +204,6 @@ Then you have to create a dedicated jest config file, and to modify your angular
    // With:
      "inlineStyleLanguage": ["scss"],
    ```

4. Open the `tsconfig.spec.json`file and replace the following line:
    ```js
    "types": [
@@ -231,15 +228,13 @@ Then you have to create a dedicated jest config file, and to modify your angular
      "lcovonly",
    ],
    ```

2. Open the `angular.json` file and add the following line to the test options:
    ```js
    "ci": true,
    "coverage": true,
    ```

3. Finally, override the NG_TEST_ARGS from your `gitlab-ci.yml` variables:
  ```
    ```yaml
    NG_TEST_ARGS: test --coverage
    ```