@@ -4,17 +4,16 @@ import { execa } from 'execa';
44import { temporaryDirectory } from 'tempy' ;
55import { describe , beforeEach , afterAll , expect , it } from 'vitest' ;
66
7+ const isWindows = process . platform === 'win32' ;
78const baseDir = path . resolve ( __dirname , '../..' ) ;
8-
99const cli = path . join ( baseDir , 'packages/cli/dist/index.js' ) ;
10+ const tmp = temporaryDirectory ( ) ;
1011
1112interface TestContext {
1213 projectName : string ;
1314 dest : string ;
1415}
1516
16- const tmp = temporaryDirectory ( ) ;
17-
1817beforeEach < TestContext > ( async ( context ) => {
1918 context . projectName = Math . random ( ) . toString ( 36 ) . substring ( 7 ) ;
2019 context . dest = path . join ( tmp , context . projectName ) ;
@@ -35,7 +34,7 @@ describe.each(['npm', 'pnpm', 'yarn'])('%s', (packageManager) => {
3534 expect ( filesToJSON ( projectFiles ) ) . toMatchFileSnapshot ( `${ snapshotPrefix } -created.json` ) ;
3635 } ) ;
3736
38- it < TestContext > ( 'should create and build a project' , async ( { projectName, dest } ) => {
37+ it . skipIf ( isWindows ) < TestContext > ( 'should create and build a project' , async ( { projectName, dest } ) => {
3938 await createProject ( projectName , packageManager , { cwd : tmp , install : true } ) ;
4039
4140 await execa ( packageManager , [ 'run' , 'build' ] , {
@@ -50,19 +49,22 @@ describe.each(['npm', 'pnpm', 'yarn'])('%s', (packageManager) => {
5049 expect ( filesToJSON ( distFiles ) ) . toMatchFileSnapshot ( `${ snapshotPrefix } -built.json` ) ;
5150 } ) ;
5251
53- it < TestContext > ( 'created project contains overwritten UnoCSS config' , async ( { projectName, dest } ) => {
54- await createProject ( projectName , packageManager , { cwd : tmp } ) ;
52+ it . skipIf ( isWindows ) < TestContext > (
53+ 'created project contains overwritten UnoCSS config' ,
54+ async ( { projectName, dest } ) => {
55+ await createProject ( projectName , packageManager , { cwd : tmp } ) ;
5556
56- const unoConfig = await fs . readFile ( `${ dest } /uno.config.ts` , 'utf8' ) ;
57+ const unoConfig = await fs . readFile ( `${ dest } /uno.config.ts` , 'utf8' ) ;
5758
58- expect ( unoConfig ) . toBe ( `\
59+ expect ( unoConfig ) . toBe ( `\
5960import { defineConfig } from '@tutorialkit/theme';
6061
6162export default defineConfig({
6263 // add your UnoCSS config here: https://unocss.dev/guide/config-file
6364});
6465` ) ;
65- } ) ;
66+ } ,
67+ ) ;
6668} ) ;
6769
6870async function createProject ( name : string , packageManager : string , options : { cwd : string ; install ?: boolean } ) {
0 commit comments