mirror of
https://github.com/actions/setup-go.git
synced 2025-07-01 05:33:43 +00:00
gobin: use execFile instead of exec to query GOPATH
Should fix the behavior on Windows.
This commit is contained in:
parent
0dbc2e7f12
commit
4241f446d8
3 changed files with 7 additions and 7 deletions
|
@ -6,12 +6,12 @@ jest.mock('child_process');
|
|||
describe('gobin', () => {
|
||||
const childProcess = require('child_process');
|
||||
|
||||
let execSpy: jest.SpyInstance;
|
||||
let execFileSpy: jest.SpyInstance;
|
||||
let gopath = path.join('home', 'user', 'go');
|
||||
|
||||
beforeEach(() => {
|
||||
execSpy = jest.spyOn(childProcess, 'exec');
|
||||
execSpy.mockImplementation((_command, callback) => {
|
||||
execFileSpy = jest.spyOn(childProcess, 'execFile');
|
||||
execFileSpy.mockImplementation((_file, _args, callback) => {
|
||||
callback('', {stdout: gopath, stderr: ''});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue