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/integrations/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"build": "astro-scripts build \"src/**/*.ts\" && astro-scripts build \"src/editor.cts\" --force-cjs --no-clean-dist && tsc",
"build:ci": "astro-scripts build \"src/**/*.ts\" && astro-scripts build \"src/editor.cts\" --force-cjs --no-clean-dist",
"dev": "astro-scripts dev \"src/**/*.ts\"",
"test": "astro-scripts test \"test/**/*.test.js\""
"test": "astro-scripts test \"test/**/*.test.ts\"",
"typecheck:tests": "tsc --build tsconfig.test.json"
},
"dependencies": {
"@sveltejs/vite-plugin-svelte": "^6.2.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import assert from 'node:assert/strict';
import { after, before, describe, it } from 'node:test';
import { load as cheerioLoad } from 'cheerio';
import { loadFixture } from '../../../astro/test/test-utils.js';
import { loadFixture, type Fixture, type DevServer } from '../../../astro/test/test-utils.js';

let fixture;
let fixture: Fixture;

// Svelte made breaking changes to async rendering in a patch.
// TODO figure out if we need to change our code or not, might just be an upstream bug.
Expand All @@ -16,7 +16,7 @@ describe.skip('Async rendering', () => {

describe('build', () => {
before(async () => {
await fixture.build();
await fixture.build({});
});

it('Can render async components', async () => {
Expand All @@ -28,8 +28,7 @@ describe.skip('Async rendering', () => {
});

describe('dev', () => {
/** @type {import('../../../astro/test/test-utils.js').Fixture} */
let devServer;
let devServer: DevServer;

before(async () => {
devServer = await fixture.startDevServer();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'node:assert/strict';
import { after, before, describe, it } from 'node:test';
import { load as cheerioLoad } from 'cheerio';
import { loadFixture } from '../../../astro/test/test-utils.js';
import { loadFixture, type Fixture, type DevServer } from '../../../astro/test/test-utils.js';

/**
* @see https://github.com/withastro/astro/issues/14252
Expand All @@ -11,7 +11,7 @@ import { loadFixture } from '../../../astro/test/test-utils.js';
* the condition is initially false during SSR.
*/

let fixture;
let fixture: Fixture;

describe('Conditional rendering styles', () => {
before(async () => {
Expand All @@ -22,7 +22,7 @@ describe('Conditional rendering styles', () => {

describe('build', () => {
before(async () => {
await fixture.build();
await fixture.build({});
});

it('includes styles for conditionally rendered Svelte components', async () => {
Expand Down Expand Up @@ -60,7 +60,7 @@ describe('Conditional rendering styles', () => {
});

describe('dev', () => {
let devServer;
let devServer: DevServer;

before(async () => {
devServer = await fixture.startDevServer();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'node:assert/strict';
import { after, before, describe, it } from 'node:test';
import { load as cheerioLoad } from 'cheerio';
import { loadFixture } from '../../../astro/test/test-utils.js';
import { loadFixture, type Fixture, type DevServer } from '../../../astro/test/test-utils.js';

/**
* @see https://github.com/withastro/astro/issues/15576
Expand All @@ -13,13 +13,13 @@ import { loadFixture } from '../../../astro/test/test-utils.js';

describe('Empty class attribute', () => {
describe('build', () => {
let fixture;
let fixture: Fixture;

before(async () => {
fixture = await loadFixture({
root: new URL('./fixtures/empty-class/', import.meta.url),
});
await fixture.build();
await fixture.build({});
});

it('should not render empty class attribute when class prop is not provided', async () => {
Expand Down Expand Up @@ -52,8 +52,8 @@ describe('Empty class attribute', () => {
});

describe('dev', () => {
let fixture;
let devServer;
let fixture: Fixture;
let devServer: DevServer;

before(async () => {
fixture = await loadFixture({
Expand Down
17 changes: 17 additions & 0 deletions packages/integrations/svelte/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": "../../../tsconfig.base.json",
"include": ["test/**/*.ts"],
"exclude": ["test/fixtures/**"],
"compilerOptions": {
"noEmit": true,
"allowJs": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"rewriteRelativeImportExtensions": true
},
"references": [
{
"path": "../../astro/tsconfig.test.json"
}
]
}
Loading