Skip to content

Commit dba8ab9

Browse files
committed
Lexical: Finished conversion/update of test files
1 parent 787e06e commit dba8ab9

File tree

15 files changed

+558
-1224
lines changed

15 files changed

+558
-1224
lines changed

jest.config.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const config: Config = {
2121
clearMocks: true,
2222

2323
// Indicates whether the coverage information should be collected while executing the test
24-
collectCoverage: true,
24+
collectCoverage: false,
2525

2626
// An array of glob patterns indicating a set of files for which coverage information should be collected
2727
// collectCoverageFrom: undefined,
@@ -164,10 +164,9 @@ const config: Config = {
164164
// testLocationInResults: false,
165165

166166
// The glob patterns Jest uses to detect test files
167-
// testMatch: [
168-
// "**/__tests__/**/*.[jt]s?(x)",
169-
// "**/?(*.)+(spec|test).[tj]s?(x)"
170-
// ],
167+
testMatch: [
168+
"**/__tests__/**/*.test.[jt]s",
169+
],
171170

172171
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
173172
// testPathIgnorePatterns: [

resources/js/wysiwyg/lexical/core/__tests__/utils/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,3 +717,11 @@ export function html(
717717
}
718718
return output;
719719
}
720+
721+
export function expectHtmlToBeEqual(expected: string, actual: string): void {
722+
expect(formatHtml(expected)).toBe(formatHtml(actual));
723+
}
724+
725+
function formatHtml(s: string): string {
726+
return s.replace(/>\s+</g, '><').replace(/\s*\n\s*/g, ' ').trim();
727+
}

resources/js/wysiwyg/lexical/core/nodes/__tests__/unit/LexicalTextNode.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
TextModeType,
2222
TextNode,
2323
} from 'lexical';
24-
import * as ReactTestUtils from 'lexical/shared/react-test-utils';
2524

2625
import {
2726
$createTestSegmentedNode,

resources/js/wysiwyg/lexical/core/shared/react-test-utils.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

resources/js/wysiwyg/lexical/link/__tests__/unit/LexicalAutoLinkNode.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
ParagraphNode,
2020
SerializedParagraphNode,
2121
TextNode,
22-
} from 'lexical/src';
22+
} from 'lexical';
2323
import {initializeUnitTest} from 'lexical/__tests__/utils';
2424

2525
const editorConfig = Object.freeze({

resources/js/wysiwyg/lexical/link/__tests__/unit/LexicalLinkNode.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
ParagraphNode,
2020
SerializedParagraphNode,
2121
TextNode,
22-
} from 'lexical/src';
22+
} from 'lexical';
2323
import {initializeUnitTest} from 'lexical/__tests__/utils';
2424

2525
const editorConfig = Object.freeze({

0 commit comments

Comments
 (0)