1
1
'use strict' ;
2
2
3
3
const { run } = require ( '../utils/test-utils' ) ;
4
+ const { existsSync } = require ( 'fs' ) ;
5
+ const { resolve } = require ( 'path' ) ;
4
6
5
7
describe ( 'cache related flags from core' , ( ) => {
6
8
it ( 'should be successful with --cache ' , ( ) => {
@@ -25,17 +27,19 @@ describe('cache related flags from core', () => {
25
27
} ) ;
26
28
27
29
it ( 'should set cache.cacheDirectory with --cache-cache-directory' , ( ) => {
28
- const { stderr, stdout } = run ( __dirname , [ '--cache-type' , 'filesystem' , '--cache-cache-directory' , '/test-cache-path' ] ) ;
30
+ const { stderr, stdout } = run ( __dirname , [ '--cache-type' , 'filesystem' , '--cache-cache-directory' , '. /test-cache-path' ] ) ;
29
31
30
32
expect ( stderr ) . toBeFalsy ( ) ;
31
33
expect ( stdout ) . toContain ( 'test-cache-path' ) ;
34
+ expect ( existsSync ( resolve ( __dirname , './test-cache-path' ) ) ) . toBeTruthy ( ) ;
32
35
} ) ;
33
36
34
37
it ( 'should set cache.cacheLocation with --cache-cache-locations' , ( ) => {
35
- const { stderr, stdout } = run ( __dirname , [ '--cache-type' , 'filesystem' , '--cache-cache-location' , '/test-locate-cache' ] ) ;
38
+ const { stderr, stdout } = run ( __dirname , [ '--cache-type' , 'filesystem' , '--cache-cache-location' , '. /test-locate-cache' ] ) ;
36
39
37
40
expect ( stderr ) . toBeFalsy ( ) ;
38
41
expect ( stdout ) . toContain ( 'test-locate-cache' ) ;
42
+ expect ( existsSync ( resolve ( __dirname , './test-locate-cache' ) ) ) . toBeTruthy ( ) ;
39
43
} ) ;
40
44
41
45
it ( 'should set cache.hashAlgorithm with --cache-hash-algorithm' , ( ) => {
0 commit comments