Skip to content

Tests are failing in CI/CD #1753

@coliff

Description

@coliff

Error

FAIL test/cli/formatters/sarif.spec.js (30.63 s)
    ● CLI › Formatter: sarif › should have stdout output with formatter sarif
  
      expect(received).toEqual(expected) // deep equality
  
      - Expected  - 1
      + Received  + 5
  
      @@ -20,11 +20,15 @@
  
        ### The following pattern is considered a rule violation:
  
        ```html
        `<span>`aaa>bbb`<ccc</span>`
      - ```",
      + ```
      +
      + ## Why this rule is important
      +
      + Special HTML characters like `<`, `>`, and `&` must be escaped to prevent them from being interpreted as HTML tags or entities. This avoids rendering issues and potential cross-site scripting (XSS) vulnerabilities.",
            "text": "Special characters must be escaped.",
          },
          "helpUri": "https://htmlhint.com/rules/spec-char-escape",
          "id": "spec-char-escape",
          "shortDescription": Object {
  
        48 |
        49 |           for (let i = 0; i < stdoutRules.length; i++) {
      > 50 |             expect(stdoutRules[i]).toEqual(
           |                                    ^
        51 |               expected['runs'][0]['tool']['driver']['rules'][i]
        52 |             )
        53 |           }
  
        at Socket.toEqual (test/cli/formatters/sarif.spec.js:50:36)
  
    ● CLI › Formatter: sarif › should have stdout output with formatter sarif
  
      expect(received).toEqual(expected) // deep equality
  
      - Expected  - 1
      + Received  + 5
  
      @@ -20,11 +20,15 @@
  
        ### The following pattern is considered a rule violation:
  
        ```html
        `<span>`aaa>bbb`<ccc</span>`
      - ```",
      + ```
      +
      + ## Why this rule is important
      +
      + Special HTML characters like `<`, `>`, and `&` must be escaped to prevent them from being interpreted as HTML tags or entities. This avoids rendering issues and potential cross-site scripting (XSS) vulnerabilities.",
            "text": "Special characters must be escaped.",
          },
          "helpUri": "https://htmlhint.com/rules/spec-char-escape",
          "id": "spec-char-escape",
          "shortDescription": Object {
  
        92 |
        93 |           for (let i = 0; i < fileRules.length; i++) {
      > 94 |             expect(fileRules[i]).toEqual(
           |                                  ^
        95 |               expected['runs'][0]['tool']['driver']['rules'][i]
        96 |             )
        97 |           }
  
        at ChildProcess.toEqual (test/cli/formatters/sarif.spec.js:94:34)
  
    ● CLI › Formatter: sarif › should have stdout output with formatter sarif
  
      thrown: "Exceeded timeout of 30000 ms for a test while waiting for `done()` to be called.
      Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
  
         6 | describe('CLI', () => {
         7 |   describe('Formatter: sarif', () => {
      >  8 |     it('should have stdout output with formatter sarif', (done) => {
           |     ^
         9 |       const expectedFileContent = fs
        10 |         .readFileSync(path.resolve(__dirname, 'sarif.sarif'), 'utf8')
        11 |         .replace(/\{\{path\}\}/g, 'test/cli/formatters/example.html')
  
        at it (test/cli/formatters/sarif.spec.js:8:5)
        at describe (test/cli/formatters/sarif.spec.js:7:3)
        at Object.describe (test/cli/formatters/sarif.spec.js:6:1)
  
  Summary of all failing tests
  FAIL test/cli/formatters/sarif.spec.js (30.63 s)
    ● CLI › Formatter: sarif › should have stdout output with formatter sarif
  
      expect(received).toEqual(expected) // deep equality
  
      - Expected  - 1
      + Received  + 5
  
      @@ -20,11 +20,15 @@
  
        ### The following pattern is considered a rule violation:
  
        ```html
        `<span>`aaa>bbb`<ccc</span>`
      - ```",
      + ```
      +
      + ## Why this rule is important
      +
      + Special HTML characters like `<`, `>`, and `&` must be escaped to prevent them from being interpreted as HTML tags or entities. This avoids rendering issues and potential cross-site scripting (XSS) vulnerabilities.",
            "text": "Special characters must be escaped.",
          },
          "helpUri": "https://htmlhint.com/rules/spec-char-escape",
          "id": "spec-char-escape",
          "shortDescription": Object {
  
        48 |
        49 |           for (let i = 0; i < stdoutRules.length; i++) {
      > 50 |             expect(stdoutRules[i]).toEqual(
           |                                    ^
        51 |               expected['runs'][0]['tool']['driver']['rules'][i]
        52 |             )
        53 |           }
  
        at Socket.toEqual (test/cli/formatters/sarif.spec.js:50:36)
  
    ● CLI › Formatter: sarif › should have stdout output with formatter sarif
  
      expect(received).toEqual(expected) // deep equality
  
      - Expected  - 1
      + Received  + 5
  
      @@ -20,11 +20,15 @@
  
        ### The following pattern is considered a rule violation:
  
        ```html
        `<span>`aaa>bbb`<ccc</span>`
      - ```",
      + ```
      +
      + ## Why this rule is important
      +
      + Special HTML characters like `<`, `>`, and `&` must be escaped to prevent them from being interpreted as HTML tags or entities. This avoids rendering issues and potential cross-site scripting (XSS) vulnerabilities.",
            "text": "Special characters must be escaped.",
          },
          "helpUri": "https://htmlhint.com/rules/spec-char-escape",
          "id": "spec-char-escape",
          "shortDescription": Object {
  
        92 |
        93 |           for (let i = 0; i < fileRules.length; i++) {
      > 94 |             expect(fileRules[i]).toEqual(
           |                                  ^
        95 |               expected['runs'][0]['tool']['driver']['rules'][i]
        96 |             )
        97 |           }
  
        at ChildProcess.toEqual (test/cli/formatters/sarif.spec.js:94:34)
  
    ● CLI › Formatter: sarif › should have stdout output with formatter sarif
  
      thrown: "Exceeded timeout of 30000 ms for a test while waiting for `done()` to be called.
      Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
  
         6 | describe('CLI', () => {
         7 |   describe('Formatter: sarif', () => {
      >  8 |     it('should have stdout output with formatter sarif', (done) => {
           |     ^
         9 |       const expectedFileContent = fs
        10 |         .readFileSync(path.resolve(__dirname, 'sarif.sarif'), 'utf8')
        11 |         .replace(/\{\{path\}\}/g, 'test/cli/formatters/example.html')
  
        at it (test/cli/formatters/sarif.spec.js:8:5)
        at describe (test/cli/formatters/sarif.spec.js:7:3)
        at Object.describe (test/cli/formatters/sarif.spec.js:6:1)
  
  
  Test Suites: 1 failed, 60 passed, 61 total
  Tests:       1 failed, 326 passed, 327 total
  Snapshots:   0 total
  Time:        31.034 s
  Ran all test suites.
Error: Final attempt failed. Child_process exited with error code 1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions