Files
shadcn-ui/packages/cli/test/utils/get-ts-config-alias-prefix.test.ts
shadcn 0374ba874d feat(cli): add min-config support for Next.js (#2454)
* feat(cli): add zero-config support for Next.js

* chore: add changeset

* feat(cli): add preflight
2024-01-16 22:05:39 +04:00

36 lines
722 B
TypeScript

import path from "path"
import { describe, expect, test } from "vitest"
import { getTsConfigAliasPrefix } from "../../src/utils/get-project-info"
describe("get ts config alias prefix", async () => {
test.each([
{
name: "next-app",
prefix: "@",
},
{
name: "next-app-src",
prefix: "#",
},
{
name: "next-pages",
prefix: "~",
},
{
name: "next-pages-src",
prefix: "@",
},
{
name: "t3-app",
prefix: "~",
},
])(`getTsConfigAliasPrefix($name) -> $prefix`, async ({ name, prefix }) => {
expect(
await getTsConfigAliasPrefix(
path.resolve(__dirname, `../fixtures/${name}`)
)
).toBe(prefix)
})
})