From 064659a70ec01bc18e040a9b682583d7ee2c0567 Mon Sep 17 00:00:00 2001 From: Rodrigo Fernandes Date: Mon, 23 Dec 2024 22:41:43 +0000 Subject: [PATCH] update tests --- jest.config.js | 1 + package-lock.json | 18 ++ package.json | 1 + src/__tests__/diff2html-tests.ts | 296 +++++++++++++++---------------- 4 files changed, 168 insertions(+), 148 deletions(-) diff --git a/jest.config.js b/jest.config.js index 93c556a4..b7f415f7 100644 --- a/jest.config.js +++ b/jest.config.js @@ -19,4 +19,5 @@ module.exports = { lines: 93, }, }, + prettierPath: require.resolve('prettier-2'), }; diff --git a/package-lock.json b/package-lock.json index acc2f399..7ec34605 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,6 +50,7 @@ "postcss-loader": "^8.1.1", "postcss-preset-env": "^10.1.2", "prettier": "^3.4.2", + "prettier-2": "npm:prettier@^2", "ts-jest": "^29.2.5", "ts-loader": "9.5.1", "ts-node": "10.9.2", @@ -14854,6 +14855,23 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prettier-2": { + "name": "prettier", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/pretty-error": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-4.0.0.tgz", diff --git a/package.json b/package.json index 072f4854..daf3f52c 100644 --- a/package.json +++ b/package.json @@ -88,6 +88,7 @@ "highlight.js": "11.9.0" }, "devDependencies": { + "prettier-2": "npm:prettier@^2", "@eslint/js": "^9.17.0", "@eslint/json": "^0.9.0", "@types/diff": "^6.0.0", diff --git a/src/__tests__/diff2html-tests.ts b/src/__tests__/diff2html-tests.ts index d9e4e8c3..6528b404 100644 --- a/src/__tests__/diff2html-tests.ts +++ b/src/__tests__/diff2html-tests.ts @@ -928,7 +928,7 @@ describe('Diff2Html', () => {
- - <!-- commented code --> + <!-- commented code -->
@@ -939,7 +939,7 @@ describe('Diff2Html', () => {
- - </div> + </div>
@@ -950,7 +950,7 @@ describe('Diff2Html', () => {
+ - <html> + <html>
@@ -961,7 +961,7 @@ describe('Diff2Html', () => {
+ - <body> + <body>
@@ -1326,78 +1326,78 @@ describe('Diff2Html', () => { colorScheme: ColorSchemeType.AUTO, }); expect(result).toMatchInlineSnapshot(` - "
-
- Files changed (1) - hide - show -
-
    -
  1. - - sample - - +1 - -1 - - -
  2. -
-
-
-
- - sample - CHANGED - -
-
-
- - - - - - - - - - - - - -
-
@@ -1 +1 @@
-
-
1
-
-
-
- - - test -
-
-
-
1
-
-
- + - test1 -
-
-
-
-
-
" - `); + "
+
+ Files changed (1) + hide + show +
+
    +
  1. + + sample + + +1 + -1 + + +
  2. +
+
+
+
+ + sample + CHANGED + +
+
+
+ + + + + + + + + + + + + +
+
@@ -1 +1 @@
+
+
1
+
+
+
+ - + test +
+
+
+
1
+
+
+ + + test1 +
+
+
+
+
+
" + `); }); }); @@ -1468,78 +1468,78 @@ describe('Diff2Html', () => { colorScheme: ColorSchemeType.DARK, }); expect(result).toMatchInlineSnapshot(` - "
-
- Files changed (1) - hide - show -
-
    -
  1. - - sample - - +1 - -1 - - -
  2. -
-
-
-
- - sample - CHANGED - -
-
-
- - - - - - - - - - - - - -
-
@@ -1 +1 @@
-
-
1
-
-
-
- - - test -
-
-
-
1
-
-
- + - test1 -
-
-
-
-
-
" - `); + "
+
+ Files changed (1) + hide + show +
+
    +
  1. + + sample + + +1 + -1 + + +
  2. +
+
+
+
+ + sample + CHANGED + +
+
+
+ + + + + + + + + + + + + +
+
@@ -1 +1 @@
+
+
1
+
+
+
+ - + test +
+
+
+
1
+
+
+ + + test1 +
+
+
+
+
+
" + `); }); }); });