Skip to content

Commit

Permalink
use skipIf
Browse files Browse the repository at this point in the history
  • Loading branch information
erickzhao committed Jan 21, 2025
1 parent e087269 commit 24bb5fd
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions test/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ describe('utils', () => {
});
});

describe('uname()', () => {
if (process.platform !== 'win32') {
it('should return the correct arch for your system', () => {
const arch = process.arch === 'arm64' ? 'arm64' : 'x86_64';
expect(uname()).toEqual(arch);
});
}
describe.skipIf(process.platform === 'win32')('uname()', () => {
it('should return the correct arch for your system', () => {
const arch = process.arch === 'arm64' ? 'arm64' : 'x86_64';
expect(uname()).toEqual(arch);
});
});

describe('withTempDirectory()', () => {
Expand Down Expand Up @@ -101,19 +99,17 @@ describe('utils', () => {
expect(getHostArch()).toEqual('armv7l');
});

if (process.platform !== 'win32') {
it('should return uname on arm 6', () => {
vi.spyOn(process, 'arch', 'get').mockReturnValue('arm');
vi.spyOn(process, 'config', 'get').mockReturnValue({
...process.config,
variables: {
//@ts-expect-error - `arm_version` actually exists
arm_version: '6',
},
});
expect(getHostArch()).toEqual(uname());
it.skipIf(process.platform === 'win32')('should return uname on arm 6', () => {
vi.spyOn(process, 'arch', 'get').mockReturnValue('arm');
vi.spyOn(process, 'config', 'get').mockReturnValue({
...process.config,
variables: {
//@ts-expect-error - `arm_version` actually exists
arm_version: '6',
},
});
}
expect(getHostArch()).toEqual(uname());
});

it('should return armv7l on arm 7', () => {
vi.spyOn(process, 'arch', 'get').mockReturnValue('arm');
Expand Down

0 comments on commit 24bb5fd

Please sign in to comment.