Skip to content

Commit 2effa8b

Browse files
committed
only run symlink test on mac/linux
1 parent 1676a0e commit 2effa8b

File tree

3 files changed

+11
-22
lines changed

3 files changed

+11
-22
lines changed

test/cli-spec.js

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -188,19 +188,15 @@ describe('command line interface', function () {
188188
) === false,
189189
);
190190
});
191-
it('should unpack static framework with all underlying symlinks unpacked', async () => {
192-
await execAsar(
193-
'p test/input/packthis-with-symlink/ tmp/packthis-with-symlink.asar --unpack *.txt --unpack-dir "{dir2/subdir,Hello.framework,WindowsMklink}" --exclude-hidden',
194-
);
195-
assert.ok(fs.existsSync('tmp/packthis-with-symlink.asar.unpacked/A/real.txt'));
196-
assert.ok(
197-
fs.existsSync('tmp/packthis-with-symlink.asar.unpacked/Hello.framework/Versions/A/Hello'),
198-
);
199-
assert.ok(fs.existsSync('tmp/packthis-with-symlink.asar.unpacked/WindowsMklink/SymlinkedDir'));
200-
assert.ok(fs.existsSync('tmp/packthis-with-symlink.asar.unpacked/WindowsMklink/Test/test.txt'));
201-
202-
// symlinks in Hello.framework can only be "followed" on mac/linux, so we have separate Windows-created symlinks via `mklink` as another test (WindowsMklink folder)
203-
if (process.platform !== 'win32') {
191+
if (os.platform() !== 'win32') {
192+
it('should unpack static framework with all underlying symlinks unpacked', async () => {
193+
await execAsar(
194+
'p test/input/packthis-with-symlink/ tmp/packthis-with-symlink.asar --unpack *.txt --unpack-dir "{dir2/subdir,Hello.framework,WindowsMklink}" --exclude-hidden',
195+
);
196+
assert.ok(fs.existsSync('tmp/packthis-with-symlink.asar.unpacked/A/real.txt'));
197+
assert.ok(
198+
fs.existsSync('tmp/packthis-with-symlink.asar.unpacked/Hello.framework/Versions/A/Hello'),
199+
);
204200
assert.equal(
205201
fs.readlinkSync('tmp/packthis-with-symlink.asar.unpacked/real.txt'),
206202
'Current/real.txt',
@@ -225,12 +221,6 @@ describe('command line interface', function () {
225221
.realpathSync('tmp/packthis-with-symlink.asar.unpacked/Hello.framework/Headers')
226222
.endsWith('tmp/packthis-with-symlink.asar.unpacked/Hello.framework/Versions/A/Headers'),
227223
);
228-
} else {
229-
assert.ok(
230-
fs
231-
.realpathSync('tmp/packthis-with-symlink.asar.unpacked/WindowsMklink/SymlinkedDir')
232-
.endsWith('tmp\\packthis-with-symlink.asar.unpacked\\WindowsMklink\\Test'),
233-
);
234-
}
235-
});
224+
});
225+
}
236226
});

test/input/packthis-with-symlink/WindowsMklink/SymlinkedDir

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/input/packthis-with-symlink/WindowsMklink/Test/test.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)