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

Code before:
		it('should return an error when using inside a client script', async () => {
			const error = await fixture.build().catch((err) => err);
			assert.equal(error instanceof AstroError, true);
			assert.equal(error.name, ServerOnlyModule.name);
		});
	});

	describe('when the experimental flag is not enabled in dev', async () => {
		before(async () => {
			fixture = await loadFixture({
				root: './fixtures/astro-manifest/',
				experimental: {
					serializeConfig: false,
				},
			});
			devServer = await fixture.startDevServer();
		});

		after(async () => {
			await devServer.stop();
		});

		it('should throw an error when importing the module', async () => {
			const response = await fixture.fetch('/server');
			const html = await response.text();
			assert.match(html, /CantUseAstroConfigModule/);
		});
	});

	describe('when the experimental flag is enabled in dev', async () => {
		before(async () => {
			fixture = await loadFixture({
				root: './fixtures/astro-manifest/',
			});
			devServer = await fixture.startDevServer();
		});

		after(async () => {
			await devServer.stop();
		});

		it('should return the expected properties', async () => {
			const response = await fixture.fetch('/server');
			const html = await response.text();

			const $ = cheerio.load(html);

			assert.ok($('#out-dir').text().endsWith('/dist/'));
			assert.ok($('#src-dir').text().endsWith('/src/'));
			assert.ok($('#cache-dir').text().endsWith('/.astro/'));
			assert.ok($('#root').text().endsWith('/'));

Review comment (suggestion):
```suggestion
			assert.match(html, /CantUseAstroConfigModuleError/);
```

Code after:
		it('should return an error when using inside a client script', async () => {
			const error = await fixture.build().catch((err) => err);
			assert.equal(error instanceof AstroError, true);
			assert.equal(error.name, ServerOnlyModule.name);
		});
	});

	describe('when the experimental flag is not enabled in dev', async () => {
		before(async () => {
			fixture = await loadFixture({
				root: './fixtures/astro-manifest/',
				experimental: {
					serializeConfig: false,
				},
			});
			devServer = await fixture.startDevServer();
		});

		after(async () => {
			await devServer.stop();
		});

		it('should throw an error when importing the module', async () => {
			const response = await fixture.fetch('/server');
			const html = await response.text();
			assert.match(html, /CantUseAstroConfigModuleError/);
		});
	});

	describe('when the experimental flag is enabled in dev', async () => {
		before(async () => {
			fixture = await loadFixture({
				root: './fixtures/astro-manifest/',
			});
			devServer = await fixture.startDevServer();
		});

		after(async () => {
			await devServer.stop();
		});

		it('should return the expected properties', async () => {
			const response = await fixture.fetch('/server');
			const html = await response.text();

			const $ = cheerio.load(html);

			assert.ok($('#out-dir').text().endsWith('/dist/'));
			assert.ok($('#src-dir').text().endsWith('/src/'));
			assert.ok($('#cache-dir').text().endsWith('/.astro/'));
			assert.ok($('#root').text().endsWith('/'));