-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: random data can be correct sometimes, fixed tests that failed …
…due to this [ci skip]
- Loading branch information
1 parent
eb2c9fe
commit dc72c7c
Showing
2 changed files
with
9 additions
and
5 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 |
---|---|---|
|
@@ -150,12 +150,14 @@ describe('Git Http', () => { | |
'agent=git/[email protected]', | ||
]); | ||
}); | ||
test.prop([fc.uint8Array({ minLength: 100 })])( | ||
test.prop([fc.uint8Array({ minLength: 100 }).noShrink()])( | ||
'parsePackRequest handles random data', | ||
async (data) => { | ||
await expect( | ||
gitHttp.parsePackRequest([Buffer.from(data)]), | ||
).rejects.toThrow(validationErrors.ErrorParse); | ||
const bufferData = Buffer.from(data); | ||
fc.pre(!/^[0-9a-f]{4}$/.test(bufferData.subarray(0, 4).toString())) | ||
await expect(gitHttp.parsePackRequest([bufferData])).rejects.toThrow( | ||
validationErrors.ErrorParse, | ||
); | ||
}, | ||
); | ||
test('generatePackData', async () => { | ||
|
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