mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-20 15:01:46 +01:00
fix(types): improve with strict mode (#1041)
This commit is contained in:
@@ -5,13 +5,13 @@ import { join } from 'path'
|
||||
|
||||
// TODO: fix these anys
|
||||
async function getTailwindCSSConfig (overrides: any = {}): Promise<[any, any]> {
|
||||
overrides.modules = [ module ]
|
||||
overrides.modules = [module]
|
||||
overrides.ssr = overrides.ssr ?? false
|
||||
overrides.hooks = overrides.hooks ?? {}
|
||||
return new Promise((resolve) => {
|
||||
overrides.hooks['tailwindcss:resolvedConfig'] = async (config) => {
|
||||
resolve([config, nuxt])
|
||||
}
|
||||
overrides.hooks['tailwindcss:resolvedConfig'] = async (config: any) => {
|
||||
resolve([config, nuxt])
|
||||
}
|
||||
const nuxt = loadNuxt({
|
||||
cwd: join(process.cwd(), 'fixtures', 'empty'),
|
||||
dev: false,
|
||||
@@ -23,7 +23,7 @@ async function getTailwindCSSConfig (overrides: any = {}): Promise<[any, any]> {
|
||||
describe('nuxt', () => {
|
||||
it('should add plugins and modules to nuxt', async () => {
|
||||
const [, lnuxt] = await getTailwindCSSConfig()
|
||||
await lnuxt.then((nuxt) => {
|
||||
await lnuxt.then((nuxt: { options: { plugins: any; _requiredModules: any; appConfig: { ui: any } }; close: () => void }) => {
|
||||
expect(nuxt.options.plugins).toContainEqual(
|
||||
expect.objectContaining({
|
||||
src: expect.stringContaining('plugins/colors'),
|
||||
@@ -116,7 +116,7 @@ describe('tailwindcss config', () => {
|
||||
negate = false
|
||||
}
|
||||
|
||||
await _nuxt.then((n) => {
|
||||
await _nuxt.then((n: { close: () => void }) => {
|
||||
n.close()
|
||||
})
|
||||
})
|
||||
|
||||
@@ -13,6 +13,7 @@ describe('Button', () => {
|
||||
[ 'black solid', { props: { color: 'black', variant: 'solid' } } ],
|
||||
[ 'rounded full', { props: { ui: { rounded: 'rounded-full' } } } ],
|
||||
[ '<UButton icon="i-heroicons-pencil-square" size="sm" color="primary" square variant="solid" />' ]
|
||||
// @ts-ignore
|
||||
])('renders %s correctly', async (nameOrHtml: string, options: ButtonOptions) => {
|
||||
if (options !== undefined) {
|
||||
options.slots = options.slots || { default: () => 'label' }
|
||||
|
||||
@@ -7,6 +7,7 @@ describe('Skeleton', () => {
|
||||
it.each([
|
||||
[ 'basic case', { } ],
|
||||
[ '<USkeleton class="h-12 w-12" :ui="{ rounded: \'rounded-full\' }" />' ]
|
||||
// @ts-ignore
|
||||
])('renders %s correctly', async (nameOrHtml: string, options: TypeOf<typeof Skeleton.props>) => {
|
||||
const html = await ComponentRender(nameOrHtml, options, Skeleton)
|
||||
expect(html).toMatchSnapshot()
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import module from '../../src/module'
|
||||
|
||||
export default defineNuxtConfig({
|
||||
modules: [
|
||||
module
|
||||
'../../src/module'
|
||||
]
|
||||
})
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
// "extends": "./.nuxt/tsconfig.json"
|
||||
}
|
||||
Reference in New Issue
Block a user