1- import { getContentAsString , isWhitedOutFile } from "../../../lib/extractor" ;
1+ import { getContentAsString } from "../../../lib/extractor" ;
22import { ExtractAction , ExtractedLayers } from "../../../lib/extractor/types" ;
33
44describe ( "index" , ( ) => {
@@ -18,39 +18,3 @@ describe("index", () => {
1818 expect ( result ) . toEqual ( "Hello, world!" ) ;
1919 } ) ;
2020} ) ;
21-
22- describe ( "isWhitedOutFile" , ( ) => {
23- test ( "should return true for files containing .wh. in their path" , ( ) => {
24- expect ( isWhitedOutFile ( "/etc/.wh.hosts" ) ) . toBe ( true ) ;
25- expect ( isWhitedOutFile ( "/var/lib/.wh.data" ) ) . toBe ( true ) ;
26- expect ( isWhitedOutFile ( "/.wh.config" ) ) . toBe ( true ) ;
27- } ) ;
28-
29- test ( "should return false for files not containing .wh." , ( ) => {
30- expect ( isWhitedOutFile ( "/etc/hosts" ) ) . toBe ( false ) ;
31- expect ( isWhitedOutFile ( "" ) ) . toBe ( false ) ;
32- expect ( isWhitedOutFile ( "/" ) ) . toBe ( false ) ;
33- } ) ;
34-
35- test ( "should return false for similar but different patterns" , ( ) => {
36- // make sure the dots are literal and not match all
37- expect ( isWhitedOutFile ( "/etc/wh.hosts" ) ) . toBe ( false ) ;
38- expect ( isWhitedOutFile ( "/etc/.whosts" ) ) . toBe ( false ) ;
39- expect ( isWhitedOutFile ( "/etc/whhosts" ) ) . toBe ( false ) ;
40-
41- // dots in wrong places
42- expect ( isWhitedOutFile ( "/etc/.w.h.hosts" ) ) . toBe ( false ) ;
43- expect ( isWhitedOutFile ( "/etc/..wh..hosts" ) ) . toBe ( false ) ;
44-
45- // case sensitive
46- expect ( isWhitedOutFile ( "/etc/.WH.hosts" ) ) . toBe ( false ) ;
47- expect ( isWhitedOutFile ( "/etc/.Wh.hosts" ) ) . toBe ( false ) ;
48- } ) ;
49-
50- test ( "should handle .wh. at different positions" , ( ) => {
51- expect ( isWhitedOutFile ( ".wh.start" ) ) . toBe ( true ) ;
52- expect ( isWhitedOutFile ( "middle.wh.file" ) ) . toBe ( true ) ;
53- expect ( isWhitedOutFile ( "end.wh." ) ) . toBe ( true ) ;
54- expect ( isWhitedOutFile ( "/deeply/nested/path/.wh.present" ) ) . toBe ( true ) ;
55- } ) ;
56- } ) ;
0 commit comments