@@ -2,7 +2,6 @@ import { requestsManager } from 'snyk-request-manager';
22import * as uuid from 'uuid' ;
33import * as path from 'path' ;
44import * as fs from 'fs' ;
5- import * as fse from 'fs-extra' ;
65import {
76 updateOrgTargets ,
87 updateTargets ,
@@ -245,7 +244,7 @@ describe('updateTargets', () => {
245244 cloneSpy . mockImplementation ( ( ) =>
246245 Promise . resolve ( {
247246 success : true ,
248- repoPath : fixture ( 'monorepo-new' ) ,
247+ repoPath : path . resolve ( fixturesFolderPath , 'monorepo-new' ) ,
249248 gitResponse : '' ,
250249 } ) ,
251250 ) ;
@@ -354,7 +353,7 @@ describe('updateTargets', () => {
354353 cloneSpy . mockImplementation ( ( ) =>
355354 Promise . resolve ( {
356355 success : true ,
357- repoPath : fixture ( 'goof' ) ,
356+ repoPath : path . resolve ( fixturesFolderPath , 'goof' ) ,
358357 gitResponse : '' ,
359358 } ) ,
360359 ) ;
@@ -464,7 +463,7 @@ describe('updateTargets', () => {
464463 cloneSpy . mockImplementation ( ( ) =>
465464 Promise . resolve ( {
466465 success : true ,
467- repoPath : fixture ( 'goof' ) ,
466+ repoPath : path . resolve ( fixturesFolderPath , 'goof' ) ,
468467 gitResponse : '' ,
469468 } ) ,
470469 ) ;
@@ -555,7 +554,7 @@ describe('updateTargets', () => {
555554 cloneSpy . mockImplementation ( ( ) =>
556555 Promise . resolve ( {
557556 success : true ,
558- repoPath : fixture ( 'goof' ) ,
557+ repoPath : path . resolve ( fixturesFolderPath , 'goof' ) ,
559558 gitResponse : '' ,
560559 } ) ,
561560 ) ;
@@ -681,7 +680,7 @@ describe('updateTargets', () => {
681680 cloneSpy . mockImplementation ( ( ) =>
682681 Promise . resolve ( {
683682 success : true ,
684- repoPath : fixture ( 'monorepo' ) ,
683+ repoPath : path . resolve ( fixturesFolderPath , 'monorepo' ) ,
685684 gitResponse : '' ,
686685 } ) ,
687686 ) ;
@@ -891,7 +890,7 @@ describe('updateTargets', () => {
891890 cloneSpy . mockImplementation ( ( ) =>
892891 Promise . resolve ( {
893892 success : true ,
894- repoPath : fixture ( 'monorepo' ) ,
893+ repoPath : path . resolve ( fixturesFolderPath , 'monorepo' ) ,
895894 gitResponse : '' ,
896895 } ) ,
897896 ) ;
@@ -1034,7 +1033,7 @@ describe('updateTargets', () => {
10341033 cloneSpy . mockImplementation ( ( ) =>
10351034 Promise . resolve ( {
10361035 success : true ,
1037- repoPath : fixture ( 'monorepo' ) ,
1036+ repoPath : path . resolve ( fixturesFolderPath , 'monorepo' ) ,
10381037 gitResponse : '' ,
10391038 } ) ,
10401039 ) ;
@@ -1401,7 +1400,7 @@ describe('updateOrgTargets', () => {
14011400 cloneSpy . mockImplementation ( ( ) =>
14021401 Promise . resolve ( {
14031402 success : true ,
1404- repoPath : fixture ( 'goof' ) ,
1403+ repoPath : path . resolve ( fixturesFolderPath , 'goof' ) ,
14051404 gitResponse : '' ,
14061405 } ) ,
14071406 ) ;
@@ -1586,7 +1585,7 @@ describe('updateOrgTargets', () => {
15861585 cloneSpy . mockImplementation ( ( ) =>
15871586 Promise . resolve ( {
15881587 success : true ,
1589- repoPath : fixture ( 'goof' ) ,
1588+ repoPath : path . resolve ( fixturesFolderPath , 'goof' ) ,
15901589 gitResponse : '' ,
15911590 } ) ,
15921591 ) ;
@@ -1877,11 +1876,3 @@ describe('bulkImportTargetFiles', () => {
18771876 expect ( updated . length ) . toEqual ( 5 ) ;
18781877 } ) ;
18791878} ) ;
1880-
1881- function fixture ( name : string ) {
1882- const tempDir = fs . mkdtempSync ( 'snyk-api-import-test-' ) ;
1883- fse . copySync ( path . resolve ( fixturesFolderPath , name ) , tempDir , {
1884- overwrite : true ,
1885- } ) ;
1886- return tempDir ;
1887- }
0 commit comments