Skip to content

Commit d1d676f

Browse files
committed
refactor(tests): update test cases to use 'test' instead of 'it'
- Replaced all instances of 'it' with 'test' in the test files for consistency across the codebase. - This change improves readability and aligns with the preferred testing syntax in the project.
1 parent b351c24 commit d1d676f

18 files changed

+104
-104
lines changed

packages/code-editor/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,7 @@ describe('useThemeExtension', () => {
12321232
const fakeStateModule = createMockStateModule();
12331233
const fakeViewModule = createMockViewModule();
12341234

1235-
it('should apply theme correctly', () => {
1235+
test('should apply theme correctly', () => {
12361236
const { result } = renderHook(() =>
12371237
useThemeExtension({
12381238
editorViewInstance: null,
@@ -1259,7 +1259,7 @@ import { useExtensions } from '@leafygreen-ui/code-editor/hooks/extensions';
12591259
describe('useExtensions', () => {
12601260
const fakeModules = createComprehensiveFakeModules();
12611261

1262-
it('should aggregate all extensions', () => {
1262+
test('should aggregate all extensions', () => {
12631263
const { result } = renderHook(() =>
12641264
useExtensions({
12651265
editorViewInstance: null,

packages/code-editor/src/CodeEditor/hooks/extensions/useAutoCompleteExtension.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('useAutoCompleteExtension', () => {
1111
const fakeStateModule = createMockStateModule();
1212
const fakeAutoModule = createMockAutoCompleteModule();
1313

14-
it('returns empty when language not set', () => {
14+
test('returns empty when language not set', () => {
1515
const { result } = renderHook(() =>
1616
useAutoCompleteExtension({
1717
editorViewInstance: null,
@@ -22,7 +22,7 @@ describe('useAutoCompleteExtension', () => {
2222
expect(result.current).toEqual([]);
2323
});
2424

25-
it('returns autocompletion extension when language set', () => {
25+
test('returns autocompletion extension when language set', () => {
2626
const { result } = renderHook(() =>
2727
useAutoCompleteExtension({
2828
editorViewInstance: null,

packages/code-editor/src/CodeEditor/hooks/extensions/useCodeFoldingExtension.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('useCodeFoldingExtension', () => {
1111
const fakeStateModule = createMockStateModule();
1212
const fakeLanguageModule = createMockLanguageModule();
1313

14-
it('returns empty when disabled or module missing', () => {
14+
test('returns empty when disabled or module missing', () => {
1515
const { result } = renderHook(() =>
1616
useCodeFoldingExtension({
1717
editorViewInstance: null,
@@ -22,7 +22,7 @@ describe('useCodeFoldingExtension', () => {
2222
expect(result.current).toEqual([]);
2323
});
2424

25-
it('returns fold gutter extension when enabled', () => {
25+
test('returns fold gutter extension when enabled', () => {
2626
const { result } = renderHook(() =>
2727
useCodeFoldingExtension({
2828
editorViewInstance: null,

packages/code-editor/src/CodeEditor/hooks/extensions/useExtensions.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useExtensions } from './useExtensions';
77
describe('useExtensions (aggregator)', () => {
88
const fakeModules = createComprehensiveFakeModules();
99

10-
it('returns an array of extensions in expected order/length', () => {
10+
test('returns an array of extensions in expected order/length', () => {
1111
const { result } = renderHook(() =>
1212
useExtensions({
1313
editorViewInstance: null,

packages/code-editor/src/CodeEditor/hooks/extensions/useHighlightExtension.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('useHighlightExtension', () => {
1313
const fakeLanguageModule = createMockLanguageModule();
1414
const fakeLezerHighlight = createMockLezerHighlightModule();
1515

16-
it('returns empty when missing modules or language', () => {
16+
test('returns empty when missing modules or language', () => {
1717
const { result } = renderHook(() =>
1818
useHighlightExtension({
1919
editorViewInstance: null,
@@ -24,7 +24,7 @@ describe('useHighlightExtension', () => {
2424
expect(result.current).toEqual([]);
2525
});
2626

27-
it('returns syntax highlighting extension when modules present', () => {
27+
test('returns syntax highlighting extension when modules present', () => {
2828
const { result } = renderHook(() =>
2929
useHighlightExtension({
3030
editorViewInstance: null,

packages/code-editor/src/CodeEditor/hooks/extensions/useHyperLinkExtension.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('useHyperLinkExtension', () => {
1111
const fakeStateModule = createMockStateModule();
1212
const fakeHyperLinkModule = createMockHyperLinkModule();
1313

14-
it('returns empty when disabled', () => {
14+
test('returns empty when disabled', () => {
1515
const { result } = renderHook(() =>
1616
useHyperLinkExtension({
1717
editorViewInstance: null,
@@ -22,7 +22,7 @@ describe('useHyperLinkExtension', () => {
2222
expect(result.current).toEqual([]);
2323
});
2424

25-
it('returns hyperlink extension when enabled', () => {
25+
test('returns hyperlink extension when enabled', () => {
2626
const { result } = renderHook(() =>
2727
useHyperLinkExtension({
2828
editorViewInstance: null,

packages/code-editor/src/CodeEditor/hooks/extensions/useIndentExtension.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('useIndentExtension', () => {
1212
const fakeStateModule = createMockStateModule();
1313
const fakeLanguageModule = createMockLanguageModule();
1414

15-
it('returns empty when required modules missing', () => {
15+
test('returns empty when required modules missing', () => {
1616
const { result } = renderHook(() =>
1717
useIndentExtension({
1818
editorViewInstance: null,
@@ -23,7 +23,7 @@ describe('useIndentExtension', () => {
2323
expect(result.current).toEqual([]);
2424
});
2525

26-
it('returns space-based indent configuration', () => {
26+
test('returns space-based indent configuration', () => {
2727
const { result } = renderHook(() =>
2828
useIndentExtension({
2929
editorViewInstance: null,
@@ -37,7 +37,7 @@ describe('useIndentExtension', () => {
3737
expect(result.current).toEqual(['INDENT_" "', 'TABSIZE_4']);
3838
});
3939

40-
it('returns tab-based indent configuration', () => {
40+
test('returns tab-based indent configuration', () => {
4141
const { result } = renderHook(() =>
4242
useIndentExtension({
4343
editorViewInstance: null,

packages/code-editor/src/CodeEditor/hooks/extensions/useLanguageExtension.spec.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('useLanguageExtension', () => {
88
const fakeStateModule = createMockStateModule();
99
const modulesBase = { '@codemirror/state': fakeStateModule } as any;
1010

11-
it('returns empty when language not provided', () => {
11+
test('returns empty when language not provided', () => {
1212
const { result } = renderHook(() =>
1313
useLanguageExtension({
1414
editorViewInstance: null,
@@ -19,7 +19,7 @@ describe('useLanguageExtension', () => {
1919
expect(result.current).toEqual([]);
2020
});
2121

22-
it('returns javascript extension with correct options', () => {
22+
test('returns javascript extension with correct options', () => {
2323
const jsMock = jest.fn(() => 'JS_EXT');
2424
const { result } = renderHook(() =>
2525
useLanguageExtension({
@@ -35,7 +35,7 @@ describe('useLanguageExtension', () => {
3535
expect(result.current).toBe('JS_EXT');
3636
});
3737

38-
it('returns jsx extension with correct options', () => {
38+
test('returns jsx extension with correct options', () => {
3939
const jsMock = jest.fn(() => 'JSX_EXT');
4040
const { result } = renderHook(() =>
4141
useLanguageExtension({
@@ -51,7 +51,7 @@ describe('useLanguageExtension', () => {
5151
expect(result.current).toBe('JSX_EXT');
5252
});
5353

54-
it('returns tsx extension with correct options', () => {
54+
test('returns tsx extension with correct options', () => {
5555
const jsMock = jest.fn(() => 'TSX_EXT');
5656
const { result } = renderHook(() =>
5757
useLanguageExtension({
@@ -67,7 +67,7 @@ describe('useLanguageExtension', () => {
6767
expect(result.current).toBe('TSX_EXT');
6868
});
6969

70-
it('returns typescript extension with correct options', () => {
70+
test('returns typescript extension with correct options', () => {
7171
const jsMock = jest.fn(() => 'TS_EXT');
7272
const { result } = renderHook(() =>
7373
useLanguageExtension({
@@ -83,7 +83,7 @@ describe('useLanguageExtension', () => {
8383
expect(result.current).toBe('TS_EXT');
8484
});
8585

86-
it('returns kotlin and ruby via StreamLanguage.define', () => {
86+
test('returns kotlin and ruby via StreamLanguage.define', () => {
8787
const defineMock = jest.fn((lang: any) => `STREAM_${lang.name || 'LANG'}`);
8888
const modules = {
8989
...modulesBase,
@@ -111,7 +111,7 @@ describe('useLanguageExtension', () => {
111111
expect(rubyRes.current).toBe('STREAM_ruby');
112112
});
113113

114-
it('returns direct language factory results for simple languages', () => {
114+
test('returns direct language factory results for simple languages', () => {
115115
const mk = (name: string) => ({
116116
[name]: jest.fn(() => `${name.toUpperCase()}_EXT`),
117117
});

packages/code-editor/src/CodeEditor/hooks/extensions/useLineNumbersExtension.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('useLineNumbersExtension', () => {
88
const fakeStateModule = createMockStateModule();
99
const fakeViewModule = createMockViewModule();
1010

11-
it('returns empty when disabled', () => {
11+
test('returns empty when disabled', () => {
1212
const { result } = renderHook(() =>
1313
useLineNumbersExtension({
1414
editorViewInstance: null,
@@ -19,7 +19,7 @@ describe('useLineNumbersExtension', () => {
1919
expect(result.current).toEqual([]);
2020
});
2121

22-
it('returns line numbers extension when enabled', () => {
22+
test('returns line numbers extension when enabled', () => {
2323
const { result } = renderHook(() =>
2424
useLineNumbersExtension({
2525
editorViewInstance: null,

packages/code-editor/src/CodeEditor/hooks/extensions/useLineWrapExtension.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('useLineWrapExtension', () => {
88
const fakeStateModule = createMockStateModule();
99
const fakeViewModule = createMockViewModule();
1010

11-
it('returns empty when disabled', () => {
11+
test('returns empty when disabled', () => {
1212
const { result } = renderHook(() =>
1313
useLineWrapExtension({
1414
editorViewInstance: null,
@@ -19,7 +19,7 @@ describe('useLineWrapExtension', () => {
1919
expect(result.current).toEqual([]);
2020
});
2121

22-
it('returns wrapping extension when enabled and module present', () => {
22+
test('returns wrapping extension when enabled and module present', () => {
2323
const { result } = renderHook(() =>
2424
useLineWrapExtension({
2525
editorViewInstance: null,

0 commit comments

Comments
 (0)