@@ -4,17 +4,16 @@ import { execa } from 'execa';
4
4
import { temporaryDirectory } from 'tempy' ;
5
5
import { describe , beforeEach , afterAll , expect , it } from 'vitest' ;
6
6
7
+ const isWindows = process . platform === 'win32' ;
7
8
const baseDir = path . resolve ( __dirname , '../..' ) ;
8
-
9
9
const cli = path . join ( baseDir , 'packages/cli/dist/index.js' ) ;
10
+ const tmp = temporaryDirectory ( ) ;
10
11
11
12
interface TestContext {
12
13
projectName : string ;
13
14
dest : string ;
14
15
}
15
16
16
- const tmp = temporaryDirectory ( ) ;
17
-
18
17
beforeEach < TestContext > ( async ( context ) => {
19
18
context . projectName = Math . random ( ) . toString ( 36 ) . substring ( 7 ) ;
20
19
context . dest = path . join ( tmp , context . projectName ) ;
@@ -35,7 +34,7 @@ describe.each(['npm', 'pnpm', 'yarn'])('%s', (packageManager) => {
35
34
expect ( filesToJSON ( projectFiles ) ) . toMatchFileSnapshot ( `${ snapshotPrefix } -created.json` ) ;
36
35
} ) ;
37
36
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 } ) => {
39
38
await createProject ( projectName , packageManager , { cwd : tmp , install : true } ) ;
40
39
41
40
await execa ( packageManager , [ 'run' , 'build' ] , {
@@ -50,19 +49,22 @@ describe.each(['npm', 'pnpm', 'yarn'])('%s', (packageManager) => {
50
49
expect ( filesToJSON ( distFiles ) ) . toMatchFileSnapshot ( `${ snapshotPrefix } -built.json` ) ;
51
50
} ) ;
52
51
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 } ) ;
55
56
56
- const unoConfig = await fs . readFile ( `${ dest } /uno.config.ts` , 'utf8' ) ;
57
+ const unoConfig = await fs . readFile ( `${ dest } /uno.config.ts` , 'utf8' ) ;
57
58
58
- expect ( unoConfig ) . toBe ( `\
59
+ expect ( unoConfig ) . toBe ( `\
59
60
import { defineConfig } from '@tutorialkit/theme';
60
61
61
62
export default defineConfig({
62
63
// add your UnoCSS config here: https://unocss.dev/guide/config-file
63
64
});
64
65
` ) ;
65
- } ) ;
66
+ } ,
67
+ ) ;
66
68
} ) ;
67
69
68
70
async function createProject ( name : string , packageManager : string , options : { cwd : string ; install ?: boolean } ) {
0 commit comments