Skip to content

Commit a11bae8

Browse files
author
Christopher McCulloh
authored
allows for __tests__ & __test__ directories (#4438)
* fixes #4435 allows for __tests__ directories * tests hard-coded __tests__ * runs changeset * Better release notes * allows `__test__` in addition to `__tests__`
1 parent 8884538 commit a11bae8

File tree

5 files changed

+12
-1
lines changed

5 files changed

+12
-1
lines changed

.changeset/modern-cameras-fetch.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
allow files and directories named `__tests__` and `__test__` in the routes directory

packages/kit/src/core/sync/create_manifest_data/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { parse_route_id } from '../../../utils/routing.js';
2525
* }} Item
2626
*/
2727

28-
const specials = new Set(['__layout', '__layout.reset', '__error']);
28+
const specials = new Set(['__layout', '__layout.reset', '__error', '__tests__', '__test__']);
2929

3030
/**
3131
* @param {{

packages/kit/src/core/sync/create_manifest_data/index.spec.js

+6
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,12 @@ test('errors on encountering an illegal __file', () => {
457457
);
458458
});
459459

460+
test('allows for __tests__ directories', () => {
461+
const { routes } = create('samples/legal-dunder');
462+
463+
assert.equal(routes, []);
464+
});
465+
460466
test('creates param matchers', () => {
461467
const { matchers } = create('samples/basic'); // directory doesn't matter for the test
462468

packages/kit/src/core/sync/create_manifest_data/test/samples/legal-dunder/__test__/legal.test.svelte

Whitespace-only changes.

packages/kit/src/core/sync/create_manifest_data/test/samples/legal-dunder/__tests__/legal.test.svelte

Whitespace-only changes.

0 commit comments

Comments
 (0)