-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ipfs v2 schema validation using a simple regex (#20)
* feat: add ipfs v2 schema validation using a simple regex * feat: update report schemas.api.md * feat: change avatar snapshots properties to ipfs v2 * feat: update report schemas.api.md
- Loading branch information
guidota
authored
Sep 23, 2021
1 parent
b869b84
commit 212f7c7
Showing
5 changed files
with
63 additions
and
25 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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import expect from 'expect' | ||
import { IPFSv2 } from '../src' | ||
import { testTypeSignature } from './test-utils' | ||
|
||
describe('Hashing tests', () => { | ||
const hash: IPFSv2 = 'bafybeiasb5vpmaounyilfuxbd3lryvosl4yefqrfahsb2esg46q6tu6y5q' | ||
|
||
testTypeSignature(IPFSv2, hash) | ||
|
||
it('static tests must pass', () => { | ||
expect(IPFSv2.validate(hash)).toEqual(true) | ||
expect(IPFSv2.validate(null)).toEqual(false) | ||
expect(IPFSv2.validate({})).toEqual(false) | ||
}) | ||
}) |
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