-
Notifications
You must be signed in to change notification settings - Fork 15
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
Showing
6 changed files
with
135 additions
and
124 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
28 changes: 28 additions & 0 deletions
28
packages/modules/packages/archivist/packages/wrapper/src/spec/MemoryArchivist.spec.ts
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,28 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
import { Account } from '@xyo-network/account' | ||
import { MemoryArchivist } from '@xyo-network/archivist-memory' | ||
import { PayloadBuilder } from '@xyo-network/payload-builder' | ||
|
||
import { ArchivistWrapper } from '../ArchivistWrapper' | ||
|
||
/** | ||
* @group module | ||
* @group archivist | ||
*/ | ||
describe('MemoryArchivist (Wrapped)', () => { | ||
it('should return same items inserted (wrapped)', async () => { | ||
const archivist = ArchivistWrapper.wrap( | ||
await MemoryArchivist.create({ account: Account.randomSync(), config: { schema: MemoryArchivist.configSchema } }), | ||
Account.randomSync(), | ||
) | ||
|
||
const payloads = [await PayloadBuilder.build({ schema: 'network.xyo.test' })] | ||
const result = await archivist.insert(payloads) | ||
|
||
expect(result).toEqual(payloads) | ||
expect(result.length).toEqual(payloads.length) | ||
expect(result[0].schema).toEqual(payloads[0].schema) | ||
}) | ||
}) |
Oops, something went wrong.