File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import * as core from '@actions/core'
2+ import * as path from 'path'
23import artifact , { ArtifactNotFoundError } from '@actions/artifact'
34import { run } from '../src/download-artifact'
45import { Inputs } from '../src/constants'
@@ -380,11 +381,12 @@ describe('download', () => {
380381 digest : 'def456'
381382 }
382383
384+ const testPath = '/test/path'
383385 mockInputs ( {
384386 [ Inputs . Name ] : '' ,
385387 [ Inputs . Pattern ] : '' ,
386388 [ Inputs . ArtifactIds ] : '456' ,
387- [ Inputs . Path ] : '/test/path'
389+ [ Inputs . Path ] : testPath
388390 } )
389391
390392 jest . spyOn ( artifact , 'listArtifacts' ) . mockImplementation ( ( ) =>
@@ -399,7 +401,7 @@ describe('download', () => {
399401 expect ( artifact . downloadArtifact ) . toHaveBeenCalledWith (
400402 456 ,
401403 expect . objectContaining ( {
402- path : '/test/ path' , // Should be the resolved path directly, not /test/path/test-artifact
404+ path : path . resolve ( testPath ) , // Should be the resolved path directly, not nested
403405 expectedHash : mockArtifact . digest
404406 } )
405407 )
You can’t perform that action at this time.
0 commit comments