Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Hargne/jest-html-reporter
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3.4.1
Choose a base ref
...
head repository: Hargne/jest-html-reporter
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3.4.2
Choose a head ref
  • 11 commits
  • 3 files changed
  • 2 contributors

Commits on May 28, 2021

  1. Bumped version

    Hargne committed May 28, 2021

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    armano2 Armano
    Copy the full SHA
    3c7eed8 View commit details

Commits on Aug 12, 2021

  1. Bump path-parse from 1.0.6 to 1.0.7

    Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
    - [Release notes](https://github.com/jbgutierrez/path-parse/releases)
    - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)
    
    ---
    updated-dependencies:
    - dependency-name: path-parse
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Aug 12, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    eeb0deb View commit details

Commits on Sep 21, 2021

  1. Bump tmpl from 1.0.4 to 1.0.5

    Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
    - [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
    - [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)
    
    ---
    updated-dependencies:
    - dependency-name: tmpl
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Sep 21, 2021
    Copy the full SHA
    d5bbc87 View commit details

Commits on Dec 1, 2021

  1. Copy the full SHA
    812bbe9 View commit details
  2. Merge pull request #130 from Hargne/dependabot/npm_and_yarn/path-pars…

    …e-1.0.7
    
    Bump path-parse from 1.0.6 to 1.0.7
    Hargne authored Dec 1, 2021
    Copy the full SHA
    a2cecea View commit details
  3. Merge pull request #132 from Hargne/dependabot/npm_and_yarn/tmpl-1.0.5

    Bump tmpl from 1.0.4 to 1.0.5
    Hargne authored Dec 1, 2021
    Copy the full SHA
    8a52d95 View commit details
  4. Bump ansi-regex from 5.0.0 to 5.0.1

    Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 5.0.0 to 5.0.1.
    - [Release notes](https://github.com/chalk/ansi-regex/releases)
    - [Commits](chalk/ansi-regex@v5.0.0...v5.0.1)
    
    ---
    updated-dependencies:
    - dependency-name: ansi-regex
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Dec 1, 2021
    Copy the full SHA
    dc41e1f View commit details
  5. Upgraded strip-ansi

    Hargne committed Dec 1, 2021
    Copy the full SHA
    48a2697 View commit details
  6. Bumped version

    Hargne committed Dec 1, 2021
    Copy the full SHA
    40cd2c5 View commit details
  7. Merge pull request #134 from Hargne/dependabot/npm_and_yarn/ansi-rege…

    …x-5.0.1
    
    Bump ansi-regex from 5.0.0 to 5.0.1
    Hargne authored Dec 1, 2021
    Copy the full SHA
    ed7f293 View commit details
  8. Merge pull request #135 from Hargne/bugfix/sanitize-xml

    Bugfix/sanitize xml
    Hargne authored Dec 1, 2021
    Copy the full SHA
    f92d1e6 View commit details
Showing with 40 additions and 16 deletions.
  1. +2 −2 package.json
  2. +16 −4 src/htmlreporter.ts
  3. +22 −10 yarn.lock
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jest-html-reporter",
"version": "3.4.0",
"version": "3.4.2",
"description": "Jest test results processor for generating a summary in HTML",
"main": "dist/index.js",
"unpkg": "dist/index.js",
@@ -51,7 +51,7 @@
"dateformat": "3.0.2",
"mkdirp": "^1.0.3",
"sinon": "^9.0.1",
"strip-ansi": "6.0.0",
"strip-ansi": "6.0.1",
"xmlbuilder": "15.0.0"
},
"peerDependencies": {
20 changes: 16 additions & 4 deletions src/htmlreporter.ts
Original file line number Diff line number Diff line change
@@ -167,7 +167,7 @@ class HTMLReporter {
failureMsgDiv.ele(
"pre",
{ class: "failureMsg" },
stripAnsi(suite.failureMessage)
this.sanitizeOutput(suite.failureMessage)
);
}

@@ -400,7 +400,7 @@ class HTMLReporter {
failureMsgDiv.ele(
"pre",
{ class: "failureMsg" },
stripAnsi(failureMsg)
this.sanitizeOutput(failureMsg)
);
});
}
@@ -458,12 +458,12 @@ class HTMLReporter {
logElement.ele(
"pre",
{ class: "suite-consolelog-item-origin" },
stripAnsi(log.origin)
this.sanitizeOutput(log.origin)
);
logElement.ele(
"pre",
{ class: "suite-consolelog-item-message" },
stripAnsi(log.message)
this.sanitizeOutput(log.message)
);
});
}
@@ -739,6 +739,18 @@ class HTMLReporter {
}
return { logColor, logMsg }; // Return for testing purposes
}

/**
* Helper method to santize output from invalid characters
*/
private sanitizeOutput(input: string) {
return stripAnsi(
input.replace(
/([^\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFC\u{10000}-\u{10FFFF}])/gu,
""
)
);
}
}

export default HTMLReporter;
32 changes: 22 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -1478,9 +1478,14 @@ ansi-escapes@^4.2.1:
type-fest "^0.21.3"

ansi-regex@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75"
integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==
version "5.0.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==

ansi-regex@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==

ansi-styles@^3.2.1:
version "3.2.1"
@@ -3116,9 +3121,9 @@ path-key@^3.0.0, path-key@^3.1.0:
integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==

path-parse@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==
version "1.0.7"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==

path-to-regexp@^1.7.0:
version "1.8.0"
@@ -3452,7 +3457,14 @@ string-width@^4.1.0, string-width@^4.2.0:
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.0"

strip-ansi@6.0.0, strip-ansi@^6.0.0:
strip-ansi@6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532"
integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==
@@ -3535,9 +3547,9 @@ throat@^6.0.1:
integrity sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w==

tmpl@1.0.x:
version "1.0.4"
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1"
integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=
version "1.0.5"
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc"
integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==

to-fast-properties@^2.0.0:
version "2.0.0"