Repository: withastro/astro
File: packages/astro/test/astro-sync.test.js (JavaScript)

Code before:
  body?: string;
  collection: "blog";
  data: InferEntrySchema<"blog">;
  rendered?: RenderedContent;
  filePath?: string;`,
				'Types file does not include empty collection type',
			);
			fixture.thenFileContentShouldInclude(
				'.astro/content.d.ts',
				`"blogMeta": Record<string, {
  id: string;
  body?: string;
  collection: "blogMeta";
  data: InferEntrySchema<"blogMeta">;
  rendered?: RenderedContent;
  filePath?: string;
}>;`,
				'Types file does not include empty collection type',
			);
		});

		it('fails when using a loader schema function', async () => {
			await fixture.load('./fixtures/content-layer-loader-schema-function/');
			fixture.clean();
			await fixture.whenSyncing();
			fixture.thenWarnLogsInclude('Since Astro 6, a loader schema cannot be a function.');
		});
	});

	describe('astro:env', () => {
		it('Adds reference to `.astro/types.d.ts`', async () => {
			await fixture.load('./fixtures/astro-env/');
			fixture.clean();
			await fixture.whenSyncing();
			fixture.thenFileShouldExist('.astro/types.d.ts');
			fixture.thenFileContentShouldInclude(
				'.astro/types.d.ts',
				`/// <reference path="env.d.ts" />`,
			);
			fixture.thenFileShouldExist('.astro/env.d.ts');
			fixture.thenFileContentShouldInclude(
				'.astro/env.d.ts',
				`declare module 'astro:env/client' {`,
				'Types file does not include `astro:env` module declaration',
			);
		});

		it('Does not throw if a public variable is required', async () => {
			try {
				await fixture.load('./fixtures/astro-env-required-public/');
				fixture.clean();

Review comment (suggestion):
```suggestion
			fixture.thenWarnLogsInclude("Your loader's schema is defined using a function.");
```

Code after:
  body?: string;
  collection: "blog";
  data: InferEntrySchema<"blog">;
  rendered?: RenderedContent;
  filePath?: string;`,
				'Types file does not include empty collection type',
			);
			fixture.thenFileContentShouldInclude(
				'.astro/content.d.ts',
				`"blogMeta": Record<string, {
  id: string;
  body?: string;
  collection: "blogMeta";
  data: InferEntrySchema<"blogMeta">;
  rendered?: RenderedContent;
  filePath?: string;
}>;`,
				'Types file does not include empty collection type',
			);
		});

		it('fails when using a loader schema function', async () => {
			await fixture.load('./fixtures/content-layer-loader-schema-function/');
			fixture.clean();
			await fixture.whenSyncing();
			fixture.thenWarnLogsInclude("Your loader's schema is defined using a function.");
		});
	});

	describe('astro:env', () => {
		it('Adds reference to `.astro/types.d.ts`', async () => {
			await fixture.load('./fixtures/astro-env/');
			fixture.clean();
			await fixture.whenSyncing();
			fixture.thenFileShouldExist('.astro/types.d.ts');
			fixture.thenFileContentShouldInclude(
				'.astro/types.d.ts',
				`/// <reference path="env.d.ts" />`,
			);
			fixture.thenFileShouldExist('.astro/env.d.ts');
			fixture.thenFileContentShouldInclude(
				'.astro/env.d.ts',
				`declare module 'astro:env/client' {`,
				'Types file does not include `astro:env` module declaration',
			);
		});

		it('Does not throw if a public variable is required', async () => {
			try {
				await fixture.load('./fixtures/astro-env-required-public/');
				fixture.clean();