Skip to content

Commit

Permalink
Merge pull request #25132 from paoloricciuti/fix-sveltekit-other-app-…
Browse files Browse the repository at this point in the history
…modules

SvelteKit: Fix missing `$app` modules
  • Loading branch information
JReinhold authored Dec 13, 2023
2 parents 0e95602 + f85710c commit a9824bc
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export function mockSveltekitStores() {
config: () => ({
resolve: {
alias: {
$app: resolve(__dirname, '../src/mocks/app/'),
'$app/forms': resolve(__dirname, '../src/mocks/app/forms.ts'),
'$app/navigation': resolve(__dirname, '../src/mocks/app/navigation.ts'),
'$app/stores': resolve(__dirname, '../src/mocks/app/stores.ts'),
},
},
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<script>
import { browser, dev, building, version } from '$app/environment';
</script>

<div data-testid="browser">{browser}</div>
<div data-testid="dev">{dev}</div>
<div data-testid="building">{building}</div>
<div data-testid="version">{version}</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script>
import { assets, base } from "$app/paths";
</script>

<div data-testid="assets">{assets}</div>
<div data-testid="base">{base}</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { expect, fn, within } from '@storybook/test';
import Environment from './Environment.svelte';

export default {
title: 'stories/sveltekit/modules/environment',
component: Environment,
tags: ['autodocs'],
};

export const Default = {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { expect, fn, within } from '@storybook/test';
import Paths from './Paths.svelte';

export default {
title: 'stories/sveltekit/modules/paths',
component: Paths,
tags: ['autodocs'],
};

export const Default = {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<script>
import { browser, dev, building, version } from '$app/environment';
</script>

<div data-testid="browser">{browser}</div>
<div data-testid="dev">{dev}</div>
<div data-testid="building">{building}</div>
<div data-testid="version">{version}</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script>
import { assets, base } from "$app/paths";
</script>

<div data-testid="assets">{assets}</div>
<div data-testid="base">{base}</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { expect, fn, within } from '@storybook/test';
import Environment from './Environment.svelte';

export default {
title: 'stories/sveltekit/modules/environment',
component: Environment,
tags: ['autodocs'],
};

export const Default = {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { expect, fn, within } from '@storybook/test';
import Paths from './Paths.svelte';

export default {
title: 'stories/sveltekit/modules/paths',
component: Paths,
tags: ['autodocs'],
};

export const Default = {};

0 comments on commit a9824bc

Please sign in to comment.