Skip to content

Commit

Permalink
fix(tests): set up correct file mode on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
paambaati committed Apr 24, 2023
1 parent 1471593 commit 4edff7e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import test from 'tape';
import nock from 'nock';
import toReadableStream from 'to-readable-stream';
import { stat as statCallback, unlinkSync } from 'node:fs';
import { platform } from 'node:os';
import { promisify } from 'node:util';
import { areObjectsEqual, downloadToFile } from '../src/utils';

Expand Down Expand Up @@ -47,8 +48,8 @@ echo "hello"
const stats = await stat(filePath);
t.equal(
stats.mode,
33261,
'downloaded file should exist and have executable permissions.'
platform() === 'win32' ? 33206 : 33261,
'downloaded file should exist and have executable permissions on valid platforms.'
);
unlinkSync(filePath);
nock.cleanAll();
Expand Down

0 comments on commit 4edff7e

Please sign in to comment.