@@ -195,3 +195,39 @@ test('glob with nested directories', async () => {
195195 assert . ok ( ! fs . existsSync ( directory2 ) ) ;
196196 assert . ok ( ! fs . existsSync ( directory3 ) ) ;
197197} ) ;
198+
199+ test ( 'empty array' , async ( ) => {
200+ await assert . doesNotReject ( trash ( [ ] ) ) ;
201+ } ) ;
202+
203+ test ( 'mixed existing and non-existing files' , async ( ) => {
204+ fs . writeFileSync ( 'exists1' , '' ) ;
205+ fs . writeFileSync ( 'exists2' , '' ) ;
206+ assert . ok ( fs . existsSync ( 'exists1' ) ) ;
207+ assert . ok ( fs . existsSync ( 'exists2' ) ) ;
208+ assert . ok ( ! fs . existsSync ( 'does-not-exist' ) ) ;
209+
210+ await trash ( [ 'exists1' , 'does-not-exist' , 'exists2' ] ) ;
211+
212+ assert . ok ( ! fs . existsSync ( 'exists1' ) ) ;
213+ assert . ok ( ! fs . existsSync ( 'exists2' ) ) ;
214+ assert . ok ( ! fs . existsSync ( 'does-not-exist' ) ) ;
215+ } ) ;
216+
217+ test ( 'single file path' , async ( ) => {
218+ fs . writeFileSync ( 'single-file' , '' ) ;
219+ assert . ok ( fs . existsSync ( 'single-file' ) ) ;
220+
221+ await trash ( 'single-file' ) ;
222+
223+ assert . ok ( ! fs . existsSync ( 'single-file' ) ) ;
224+ } ) ;
225+
226+ test ( 'empty directory' , async ( ) => {
227+ fs . mkdirSync ( 'empty-dir' ) ;
228+ assert . ok ( fs . existsSync ( 'empty-dir' ) ) ;
229+
230+ await trash ( 'empty-dir' ) ;
231+
232+ assert . ok ( ! fs . existsSync ( 'empty-dir' ) ) ;
233+ } ) ;
0 commit comments