11"use strict" ;
22
3- jest . mock ( "cmd-shim" ) ;
3+ jest . mock ( "@zkochan/ cmd-shim" ) ;
44jest . mock ( "fs-extra" ) ;
55
6- const cmdShim = require ( "cmd-shim" ) ;
6+ const cmdShim = require ( "@zkochan/ cmd-shim" ) ;
77const fs = require ( "fs-extra" ) ;
88const path = require ( "path" ) ;
9- const callsBack = require ( "@lerna-test/calls-back" ) ;
109const createSymlink = require ( ".." ) ;
1110
1211const linkRelative = ( from , to ) => path . relative ( path . dirname ( to ) , from ) ;
@@ -16,8 +15,7 @@ describe("create-symlink", () => {
1615 fs . unlink . mockResolvedValue ( ) ;
1716 fs . symlink . mockResolvedValue ( ) ;
1817 fs . pathExists . mockResolvedValue ( true ) ;
19- // cmdShim is a traditional errback
20- cmdShim . mockImplementation ( callsBack ( ) ) ;
18+ cmdShim . mockResolvedValue ( ) ;
2119
2220 if ( process . platform !== "win32" ) {
2321 it ( "creates relative symlink to a directory" , async ( ) => {
@@ -63,11 +61,11 @@ describe("create-symlink", () => {
6361 await createSymlink ( src , dst , type ) ;
6462
6563 expect ( fs . lstat ) . not . toHaveBeenCalled ( ) ;
66- expect ( cmdShim ) . toHaveBeenLastCalledWith ( src , dst , expect . any ( Function ) ) ;
64+ expect ( cmdShim ) . toHaveBeenLastCalledWith ( src , dst ) ;
6765 } ) ;
6866
6967 it ( "rejects when cmd-shim errors" , async ( ) => {
70- cmdShim . mockImplementationOnce ( callsBack ( new Error ( "yikes" ) ) ) ;
68+ cmdShim . mockImplementationOnce ( ( ) => Promise . reject ( new Error ( "yikes" ) ) ) ;
7169
7270 try {
7371 await createSymlink ( "src" , "dst" , "exec" ) ;
0 commit comments