0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

Start of ts in hoisted scripts

This commit is contained in:
Matthew Phillips 2022-06-03 11:51:19 -04:00
parent bdb5965d9e
commit 5850d4f4d0
2 changed files with 37 additions and 0 deletions

View file

@ -0,0 +1,19 @@
---
---
<html>
<head>
<title>Testing</title>
</head>
<body>
<h1>Testing</h1>
<script>
interface Props {
foo: string;
}
const props: Props = {
foo: 'bar'
};
</script>
</body>
</html>

View file

@ -0,0 +1,18 @@
import { expect } from 'chai';
import * as cheerio from 'cheerio';
import { loadFixture } from './test-utils.js';
describe('Using TypeScript in hoisted scripts', () => {
/** @type {import('./test-utils').Fixture} */
let fixture;
before(async () => {
fixture = await loadFixture({ root: './fixtures/ts-in-hoisted-script/' });
await fixture.build();
});
it('works', async () => {
const html = await fixture.readFile('/index.html');
console.log(html);
});
});