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:
parent
bdb5965d9e
commit
5850d4f4d0
2 changed files with 37 additions and 0 deletions
19
packages/astro/test/fixtures/ts-in-hoisted-script/src/pages/index.astro
vendored
Normal file
19
packages/astro/test/fixtures/ts-in-hoisted-script/src/pages/index.astro
vendored
Normal 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>
|
18
packages/astro/test/ts-in-hoisted-script.test.js
Normal file
18
packages/astro/test/ts-in-hoisted-script.test.js
Normal 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);
|
||||
});
|
||||
});
|
Loading…
Reference in a new issue