-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* start typechecking tests dir * aliases * add some types * fix some stuff * fix a bunch of types * fix types * Update packages/kit/test/apps/basics/src/routes/store/__tests__.js Co-authored-by: Ignatius Bagus <ignatius.mbs@gmail.com> * undefined -> void Co-authored-by: Ignatius Bagus <ignatius.mbs@gmail.com>
- Loading branch information
1 parent
cac3f3e
commit 41ed727
Showing
77 changed files
with
257 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
declare global { | ||
interface Window { | ||
navigated: Promise<void>; | ||
started: boolean; | ||
} | ||
|
||
const goto: ( | ||
href: string, | ||
opts?: { | ||
replaceState?: boolean; | ||
noScroll?: boolean; | ||
} | ||
) => Promise<void>; | ||
|
||
const prefetch: (url: string) => Promise<void>; | ||
const prefetchRoutes: (urls?: string[]) => Promise<void>; | ||
} | ||
|
||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/** @type {import('@sveltejs/kit').RequestHandler} */ | ||
export function get({ host }) { | ||
return { | ||
body: { host } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/kit/test/apps/basics/src/routes/accessibility/__tests__.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/kit/test/apps/basics/src/routes/asset-import/__tests__.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 12 additions & 8 deletions
20
packages/kit/test/apps/basics/src/routes/caching/__tests__.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,32 @@ | ||
import * as assert from 'uvu/assert'; | ||
|
||
/** @type {import('../../../../../types').TestMaker} */ | ||
/** @type {import('test').TestMaker} */ | ||
export default function (test) { | ||
test('caches pages', async ({ fetch }) => { | ||
test('caches pages', null, async ({ fetch }) => { | ||
const { headers } = await fetch('/caching'); | ||
|
||
assert.equal(headers.get('cache-control'), 'public, max-age=30'); | ||
}); | ||
|
||
test('sets cache-control: private if page uses session', async ({ fetch }) => { | ||
test('sets cache-control: private if page uses session', null, async ({ fetch }) => { | ||
const { headers } = await fetch('/caching/private/uses-session'); | ||
|
||
assert.equal(headers.get('cache-control'), 'private, max-age=30'); | ||
}); | ||
|
||
test('sets cache-control: private if page uses fetch', async ({ fetch }) => { | ||
test('sets cache-control: private if page uses fetch', null, async ({ fetch }) => { | ||
const { headers } = await fetch('/caching/private/uses-fetch?credentials=include'); | ||
|
||
assert.equal(headers.get('cache-control'), 'private, max-age=30'); | ||
}); | ||
|
||
test('sets cache-control: public if page uses fetch without credentials', async ({ fetch }) => { | ||
const { headers } = await fetch('/caching/private/uses-fetch?credentials=omit'); | ||
test( | ||
'sets cache-control: public if page uses fetch without credentials', | ||
null, | ||
async ({ fetch }) => { | ||
const { headers } = await fetch('/caching/private/uses-fetch?credentials=omit'); | ||
|
||
assert.equal(headers.get('cache-control'), 'public, max-age=30'); | ||
}); | ||
assert.equal(headers.get('cache-control'), 'public, max-age=30'); | ||
} | ||
); | ||
} |
4 changes: 2 additions & 2 deletions
4
packages/kit/test/apps/basics/src/routes/content-type-header/__tests__.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/kit/test/apps/basics/src/routes/delete-route/[id].json.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/kit/test/apps/basics/src/routes/delete-route/__tests__.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/kit/test/apps/basics/src/routes/errors/endpoint.json.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/** @type {import('@sveltejs/kit').RequestHandler} */ | ||
export function get() { | ||
throw new Error('nope'); | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/kit/test/apps/basics/src/routes/errors/nested-error-page/__tests__.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/kit/test/apps/basics/src/routes/load/[dynamic].json.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/** @type {import('@sveltejs/kit').RequestHandler} */ | ||
export function get({ params }) { | ||
return { | ||
body: { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/kit/test/apps/basics/src/routes/load/fetch-credentialed.json.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/** @type {import('@sveltejs/kit').RequestHandler} */ | ||
export function get(request) { | ||
return { | ||
body: { | ||
|
2 changes: 1 addition & 1 deletion
2
packages/kit/test/apps/basics/src/routes/load/fetch-credentialed.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/kit/test/apps/basics/src/routes/load/fetch-request.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/kit/test/apps/basics/src/routes/load/large-response.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
packages/kit/test/apps/basics/src/routes/middleware/__tests__.js
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
packages/kit/test/apps/basics/src/routes/middleware/index.svelte
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
packages/kit/test/apps/basics/src/routes/middleware/index_.js
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
packages/kit/test/apps/basics/src/routes/nested-layout/__tests__.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/kit/test/apps/basics/src/routes/nested-layout/reset/__tests__.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/kit/test/apps/basics/src/routes/no-hydrate/__tests__.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/kit/test/apps/basics/src/routes/no-hydrate/index.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/kit/test/apps/basics/src/routes/no-router/__tests__.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
41ed727
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: