1- import { getContentAsString , isWhitedOutFile , removeWhiteoutPrefix } from "../../../lib/extractor" ;
1+ import {
2+ getContentAsString ,
3+ isWhitedOutFile ,
4+ removeWhiteoutPrefix ,
5+ } from "../../../lib/extractor" ;
26import { ExtractAction , ExtractedLayers } from "../../../lib/extractor/types" ;
37
48describe ( "index" , ( ) => {
@@ -69,18 +73,24 @@ describe("removeWhiteoutPrefix", () => {
6973 expect ( removeWhiteoutPrefix ( "/etc/.wh.hosts" ) ) . toBe ( "/etc/hosts" ) ;
7074 expect ( removeWhiteoutPrefix ( "/var/lib/.wh.data" ) ) . toBe ( "/var/lib/data" ) ;
7175 expect ( removeWhiteoutPrefix ( "/.wh.config" ) ) . toBe ( "/config" ) ;
72- expect ( removeWhiteoutPrefix ( "/deeply/nested/path/.wh.present" ) ) . toBe ( "/deeply/nested/path/present" ) ;
76+ expect ( removeWhiteoutPrefix ( "/deeply/nested/path/.wh.present" ) ) . toBe (
77+ "/deeply/nested/path/present" ,
78+ ) ;
7379 expect ( removeWhiteoutPrefix ( "/path/to/.wh." ) ) . toBe ( "/path/to/" ) ;
7480 } ) ;
7581
7682 test ( "should not modify files that don't have .wh. prefix in the correct position" , ( ) => {
7783 expect ( removeWhiteoutPrefix ( "normal.file" ) ) . toBe ( "normal.file" ) ;
7884 expect ( removeWhiteoutPrefix ( "/etc/hosts" ) ) . toBe ( "/etc/hosts" ) ;
7985 expect ( removeWhiteoutPrefix ( "middle.wh.file" ) ) . toBe ( "middle.wh.file" ) ;
80- expect ( removeWhiteoutPrefix ( "/path/middle.wh.file" ) ) . toBe ( "/path/middle.wh.file" ) ;
86+ expect ( removeWhiteoutPrefix ( "/path/middle.wh.file" ) ) . toBe (
87+ "/path/middle.wh.file" ,
88+ ) ;
8189 expect ( removeWhiteoutPrefix ( ".whfile" ) ) . toBe ( ".whfile" ) ;
8290 expect ( removeWhiteoutPrefix ( "/path/.whfile" ) ) . toBe ( "/path/.whfile" ) ;
83- expect ( removeWhiteoutPrefix ( "/path/has/.wh./in/middle" ) ) . toBe ( "/path/has/.wh./in/middle" ) ;
91+ expect ( removeWhiteoutPrefix ( "/path/has/.wh./in/middle" ) ) . toBe (
92+ "/path/has/.wh./in/middle" ,
93+ ) ;
8494 } ) ;
8595
8696 test ( "should handle edge cases" , ( ) => {
@@ -92,7 +102,11 @@ describe("removeWhiteoutPrefix", () => {
92102 } ) ;
93103
94104 test ( "should not remove .wh. that appears in the middle of paths" , ( ) => {
95- expect ( removeWhiteoutPrefix ( "/the/.wh./in/path/file" ) ) . toBe ( "/the/.wh./in/path/file" ) ;
96- expect ( removeWhiteoutPrefix ( "/path/.wh.dir/.wh.file" ) ) . toBe ( "/path/.wh.dir/file" ) ;
105+ expect ( removeWhiteoutPrefix ( "/the/.wh./in/path/file" ) ) . toBe (
106+ "/the/.wh./in/path/file" ,
107+ ) ;
108+ expect ( removeWhiteoutPrefix ( "/path/.wh.dir/.wh.file" ) ) . toBe (
109+ "/path/.wh.dir/file" ,
110+ ) ;
97111 } ) ;
98112} ) ;
0 commit comments