Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/internal-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
"build": "astro-scripts build \"src/**/*.ts\" && tsc -p tsconfig.json",
"build:ci": "astro-scripts build \"src/**/*.ts\"",
"dev": "astro-scripts dev \"src/**/*.ts\"",
"test": "astro-scripts test \"test/**/*.test.js\""
"test": "astro-scripts test \"test/**/*.test.ts\"",
"typecheck:tests": "tsc -p tsconfig.test.json --noEmit"
},
"dependencies": {
"picomatch": "^4.0.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ describe('isParentDirectory', () => {
});

it('should correctly reject non-parent relationships', () => {
const invalidCases = [
const invalidCases: Array<[string, string]> = [
// Different directories
['/home', '/usr'],
['/home/user', '/home/otheruser'],
Expand Down Expand Up @@ -681,8 +681,11 @@ describe('isParentDirectory', () => {
['', '/home'],
['/home', ''],
['', ''],
// @ts-expect-error: expected to handle null/undefined gracefully
[null, '/home'],
// @ts-expect-error: expected to handle null/undefined gracefully
['/home', null],
// @ts-expect-error: expected to handle null/undefined gracefully
[undefined, '/home'],

// Same path (not parent-child)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ describe('getClientIpAddress', () => {
/**
* Helper to create a minimal Request with given headers.
*/
function makeRequest(headers = {}) {
function makeRequest(headers: HeadersInit = {}) {
return new Request('https://example.com', { headers });
}

Expand Down
12 changes: 12 additions & 0 deletions packages/internal-helpers/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../../tsconfig.base.json",
"include": ["test/**/*.ts"],
"exclude": ["test/fixtures/**"],
"compilerOptions": {
"allowJs": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"rewriteRelativeImportExtensions": true
},
"references": [{ "path": "../astro/tsconfig.test.json" }]
}
Loading