This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vitest.config.mjs | |
import { defineConfigWithNuxtEnv } from 'vitest-environment-nuxt/config' | |
export default defineConfigWithNuxtEnv({ | |
test: { | |
globals: true, | |
}, | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script setup lang="ts"> | |
enum VariantEnum { | |
PRIMARY = 'primary', | |
SECONDARY = 'secondary', | |
} | |
// Turn enums into string union types! | |
type TypeFromEnum<T> = T extends `${infer U}` ? U : never; | |
type VariantType = TypeFromEnum<VariantEnum>; |
OlderNewer