Skip to content

Commit d0d71cf

Browse files
test(utils): fix types
1 parent 2b7d3ee commit d0d71cf

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/utils.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ import { getBinaryPath, getDownloadObject } from './utils';
55
jest.mock('os');
66
const mockedOs = jest.mocked(os);
77

8-
const platforms = ['darwin', 'linux', 'win32'] as const;
9-
const architectures = ['arm', 'x32', 'x64'] as const;
8+
const platforms: NodeJS.Platform[] = ['darwin', 'linux', 'win32'];
9+
const architectures = ['arm', 'x32', 'x64'] as NodeJS.Architecture[];
1010

1111
const table = platforms.reduce(
1212
(testSuites, os) => [
1313
...testSuites,
14-
...architectures.map((arch) => [os, arch] as [string, string]),
14+
...architectures.map(
15+
(arch) => [os, arch] as [NodeJS.Platform, NodeJS.Architecture],
16+
),
1517
],
16-
[] as [string, string][],
18+
[] as [NodeJS.Platform, NodeJS.Architecture][],
1719
);
1820

1921
describe('getDownloadObject', () => {
@@ -22,7 +24,7 @@ describe('getDownloadObject', () => {
2224

2325
beforeEach(() => {
2426
jest.resetAllMocks();
25-
mockedOs.platform.mockReturnValueOnce(os as NodeJS.Platform);
27+
mockedOs.platform.mockReturnValueOnce(os);
2628
mockedOs.arch.mockReturnValueOnce(arch);
2729
});
2830

0 commit comments

Comments
 (0)