mirror of
https://github.com/iflytek/skillhub.git
synced 2026-08-28 11:25:00 +00:00
test(cli): normalize ZIP paths for cross-platform compatibility
Windows ZIP library produces backslashes in file paths while Unix uses forward slashes. Normalize all paths to forward slashes before assertion to ensure tests pass on all platforms.
This commit is contained in:
parent
8a7770c5e3
commit
c8e145d158
1 changed files with 2 additions and 1 deletions
|
|
@ -304,7 +304,8 @@ describe('publish command — content shape', () => {
|
|||
const entries = unzipSync(captured!)
|
||||
// Filter out directory marker entries (zip records empty entries for
|
||||
// dirs with a trailing slash); we only care about file entries.
|
||||
const files = Object.keys(entries).filter(k => !k.endsWith('/')).sort()
|
||||
// Normalize path separators for cross-platform compatibility (Windows uses backslashes).
|
||||
const files = Object.keys(entries).filter(k => !k.endsWith('/')).map(k => k.replace(/\\/g, '/')).sort()
|
||||
expect(files).toEqual([
|
||||
'SKILL.md',
|
||||
'references/a.md',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue