Skip to content

Commit ff03fa7

Browse files
authored
Merge pull request #48 from labd/chore/test-files
chore: standardise test file location
2 parents c159e15 + 6bbbfb3 commit ff03fa7

16 files changed

Lines changed: 455 additions & 16 deletions

.changeset/loud-steaks-heal.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-loqate': patch
3+
---
4+
5+
Reorganize test file structure for improved maintainability. Move test files from nested `__tests__` directories to cleaner locations, consolidate fixtures and snapshots in dedicated testing folders, and update import paths accordingly.

src/index.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import userEvent from '@testing-library/user-event';
33
import { fetch } from 'cross-fetch';
44
import React from 'react';
55
import { afterAll, afterEach, beforeAll, expect, it, vi } from 'vitest';
6-
import ErrorBoundary from './__tests__/ErrorBoundary';
7-
import { selection } from './__tests__/__fixtures__/selection';
8-
import { server } from './__tests__/server';
9-
import { errorHandler } from './__tests__/serverHandlers';
6+
import ErrorBoundary from './ErrorBoundary';
107
import AddressSearch from './index';
8+
import { server } from './server';
9+
import { errorHandler } from './serverHandlers';
10+
import { selection } from './testing/fixtures/selection';
1111
import Loqate from './utils/Loqate';
1212

1313
global.fetch = fetch;
File renamed without changes.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import {
44
LOQATE_BASE_URL,
55
LOQATE_FIND_URL,
66
LOQATE_RETRIEVE_URL,
7-
} from '../constants/loqate';
8-
import { selection } from './__fixtures__/selection';
9-
import { suggestions } from './__fixtures__/suggestions';
7+
} from './constants/loqate';
8+
import { selection } from './testing/fixtures/selection';
9+
import { suggestions } from './testing/fixtures/suggestions';
1010

1111
export const handlers = [
1212
http.get(`${LOQATE_BASE_URL}/${LOQATE_FIND_URL}`, async ({ request }) => {

0 commit comments

Comments
 (0)