-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
37f27d3
commit 4b647f0
Showing
5 changed files
with
51 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { BadRequest, NotFound } from './error.js'; | ||
|
||
describe('Error', () => { | ||
it.each([ | ||
['BadRequest', BadRequest], | ||
['NotFound', NotFound], | ||
])( | ||
'Errors should inherit Base error and names should be applied appropriately', | ||
(name, errorClass) => { | ||
const message = 'This is a test error'; | ||
const error = new errorClass(message); | ||
expect(error.name).toEqual(name); | ||
expect(error.message).toEqual(message); | ||
}, | ||
); | ||
}); |
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,14 @@ | ||
import { ARNS_REGISTRY_TX } from '../constants.js'; | ||
import { validateArweaveId } from './arweave.js'; | ||
|
||
describe('Arweave ID Validation', () => { | ||
it('should validate a valid Arweave ID', () => { | ||
const validId = ARNS_REGISTRY_TX; | ||
expect(validateArweaveId(validId)).toBe(true); | ||
}); | ||
|
||
it('should not validate an invalid Arweave ID', () => { | ||
const invalidId = 'invalid-id'; | ||
expect(validateArweaveId(invalidId)).toBe(false); | ||
}); | ||
}); |