@@ -4,41 +4,43 @@ import { TailwindCompiler } from "../../internal/compiler"
44import { CSSAnalyzer } from "../css_analyzer"
55import { TypeSchemaGenerator } from "../../type_tools"
66
7- describe ( "TypeGenerator" , ( ) => {
8- // dependencies
9- const compiler = new TailwindCompiler ( {
10- cssRoot : `${ __dirname } /__mocks__/tailwind.css` ,
11- base : "packages/create-tailwind-type/node_modules/tailwindcss" ,
12- } )
13- const cssAnalyzer = new CSSAnalyzer ( )
14- const schemaGenerator = new TypeSchemaGenerator ( )
7+ describe (
8+ "TypeGenerator" ,
9+ ( ) => {
10+ // dependencies
11+ const compiler = new TailwindCompiler ( {
12+ cssRoot : `${ __dirname } /__mocks__/tailwind.css` ,
13+ base : "packages/create-tailwind-type/node_modules/tailwindcss" ,
14+ } )
15+ const cssAnalyzer = new CSSAnalyzer ( )
16+ const schemaGenerator = new TypeSchemaGenerator ( )
1517
16- const generator = new TailwindTypeGenerator ( {
17- compiler,
18- cssAnalyzer,
19- generator : schemaGenerator ,
20- storeRoot : `${ __dirname } /__mocks__/store/docs.json` ,
21- } ) . setGenOptions ( {
22- useDocs : true ,
23- useExactVariants : false ,
24- useArbitraryValue : false ,
25- useSoftVariants : true ,
26- useStringKindVariantsOnly : false ,
27- useOptionalProperty : false ,
28- disableVariants : true ,
29- } )
18+ const generator = new TailwindTypeGenerator ( {
19+ compiler,
20+ cssAnalyzer,
21+ generator : schemaGenerator ,
22+ storeRoot : `${ __dirname } /__mocks__/store/docs.json` ,
23+ } ) . setGenOptions ( {
24+ useDocs : true ,
25+ useExactVariants : false ,
26+ useArbitraryValue : false ,
27+ useSoftVariants : true ,
28+ useStringKindVariantsOnly : false ,
29+ useOptionalProperty : false ,
30+ disableVariants : true ,
31+ } )
3032
31- it ( "should init" , async ( ) => {
32- await generator . init ( )
33+ it ( "should init" , async ( ) => {
34+ await generator . init ( )
3335
34- expect ( generator . ds ) . toBeDefined ( )
35- expect ( generator . classList . length ) . toBeGreaterThan ( 0 )
36- expect ( generator . variantsEntry . length ) . toBeGreaterThan ( 0 )
37- expect ( generator . variants . length ) . toBeGreaterThan ( 0 )
38- } )
36+ expect ( generator . ds ) . toBeDefined ( )
37+ expect ( generator . classList . length ) . toBeGreaterThan ( 0 )
38+ expect ( generator . variantsEntry . length ) . toBeGreaterThan ( 0 )
39+ expect ( generator . variants . length ) . toBeGreaterThan ( 0 )
40+ } )
3941
40- it ( "should extract all the possible variants" , ( ) => {
41- expect ( generator . variants ) . toMatchInlineSnapshot ( `
42+ it ( "should extract all the possible variants" , ( ) => {
43+ expect ( generator . variants ) . toMatchInlineSnapshot ( `
4244 [
4345 "*",
4446 "**",
@@ -441,11 +443,15 @@ describe("TypeGenerator", () => {
441443 "noscript",
442444 ]
443445 ` )
444- } )
446+ } )
445447
446- it ( "should build types" , async ( ) => {
447- await generator . buildTypes ( {
448- tailwind : `${ __dirname } /__mocks__/dist/tailwind.ts` ,
448+ it ( "should build types" , async ( ) => {
449+ await generator . buildTypes ( {
450+ tailwind : `${ __dirname } /__mocks__/dist/tailwind.ts` ,
451+ } )
449452 } )
450- } )
451- } )
453+ } ,
454+ {
455+ timeout : 1000 * 20 ,
456+ }
457+ )
0 commit comments