Skip to content

Commit d708e42

Browse files
committed
test: native typescript loader
1 parent 27ac983 commit d708e42

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2+
3+
exports[`built-in typescript 1`] = `
4+
{
5+
"foo": "bar",
6+
}
7+
`;

test/built-in.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { resolve } from 'node:path'
2+
import { expect, it } from 'vitest'
3+
import { loadConfig } from '../src'
4+
5+
const fixtureDir = resolve(__dirname, 'fixtures')
6+
7+
it.skipIf(!process.features.typescript && !process.versions.bun)('built-in typescript', async () => {
8+
const cwd = resolve(fixtureDir, 'builtin')
9+
const result = await loadConfig({
10+
sources: [{ files: 'un.config' }],
11+
cwd,
12+
})
13+
expect(result.config).toMatchSnapshot()
14+
})

test/fixtures/builtin/un.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
let foo: string = 'bar'
2+
3+
export default {
4+
foo,
5+
}

0 commit comments

Comments
 (0)