Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(patch): the hash of the patch file should be the same on both Win…
- Loading branch information
Showing
6 changed files
with
27 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@pnpm/crypto.base32-hash": patch | ||
"pnpm": patch | ||
--- | ||
|
||
The hash of the patch file should be the same on both Windows and POSIX [#4961](https://github.com/pnpm/pnpm/issues/4961). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
/// <reference path="../../../typings/index.d.ts"/> | ||
import { createBase32Hash } from '@pnpm/crypto.base32-hash' | ||
import fs from 'fs' | ||
import { createBase32Hash, createBase32HashFromFile } from '@pnpm/crypto.base32-hash' | ||
import { tempDir } from '@pnpm/prepare' | ||
|
||
test('createBase32Hash()', () => { | ||
expect(createBase32Hash('AAA')).toEqual('4h5p7m7gcttmf65hikljmi4gw4') | ||
}) | ||
|
||
test('createBase32HashFromFile normalizes line endings before calculating the hash', async () => { | ||
tempDir() | ||
fs.writeFileSync('win-eol.txt', 'a\r\nb\r\nc') | ||
fs.writeFileSync('posix-eol.txt', 'a\nb\r\nc') | ||
expect(await createBase32HashFromFile('win-eol.txt')).toEqual(await createBase32HashFromFile('posix-eol.txt')) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.