Skip to content

Commit c171291

Browse files
committed
fix: unit tests windows stub fix for github workflow
1 parent 1df80fd commit c171291

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

setup-local/test/binaryControl.test.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,22 @@ describe('Binary Control Operations', () => {
3939
const platformAndBinary = [
4040
{
4141
binary: BINARY_LINKS.DARWIN,
42-
folder: ['/work', 'binary', LOCAL_BINARY_FOLDER, 'darwin'],
42+
folder: `/work/binary/${LOCAL_BINARY_FOLDER}/darwin`,
4343
arch: 'x64',
4444
platform: PLATFORMS.DARWIN,
4545
}, {
4646
binary: BINARY_LINKS.LINUX_32,
47-
folder: ['/work', 'binary', LOCAL_BINARY_FOLDER, 'linux'],
47+
folder: `/work/binary/${LOCAL_BINARY_FOLDER}/linux`,
4848
arch: 'x32',
4949
platform: PLATFORMS.LINUX,
5050
}, {
5151
binary: BINARY_LINKS.LINUX_64,
52-
folder: ['/work', 'binary', LOCAL_BINARY_FOLDER, 'linux'],
52+
folder: `/work/binary/${LOCAL_BINARY_FOLDER}/linux`,
5353
arch: 'x64',
5454
platform: PLATFORMS.LINUX,
5555
}, {
5656
binary: BINARY_LINKS.WINDOWS,
57-
folder: ['/work', 'binary', LOCAL_BINARY_FOLDER, 'win32'],
57+
folder: `/work/binary/${LOCAL_BINARY_FOLDER}/win32`,
5858
arch: 'x32',
5959
platform: PLATFORMS.WIN32,
6060
},
@@ -64,11 +64,13 @@ describe('Binary Control Operations', () => {
6464
it(`decides the binary and the folder based on the platform and architecture for ${system.platform} - ${system.arch}`, () => {
6565
sinon.stub(os, 'platform').returns(system.platform);
6666
sinon.stub(os, 'arch').returns(system.arch);
67+
sinon.stub(path, 'resolve').returns(system.folder);
6768
const binaryControl = new BinaryControl();
6869
expect(binaryControl.binaryLink).to.eql(system.binary);
69-
expect(binaryControl.binaryFolder).to.include(path.resolve(...system.folder));
70+
expect(binaryControl.binaryFolder).to.eq(system.folder);
7071
os.platform.restore();
7172
os.arch.restore();
73+
path.resolve.restore();
7274
});
7375
});
7476

0 commit comments

Comments
 (0)