@storage-kernel/testing
v0.1.0-alpha.6
Published
Shared Storage Kernel contract tests and test utilities
Maintainers
Readme
@storage-kernel/testing
Shared contract tests and integration-test helpers for Storage Kernel providers.
This package belongs to the Storage Kernel package family. It is intended for provider authors and repository tests, not normal application runtime code.
Install
npm install --save-dev @storage-kernel/testing vitestContract Tests
Use defineClientContractTests to verify that a provider follows the shared StorageClient contract.
import { defineClientContractTests } from '@storage-kernel/testing';
import { createLocalFilesystemStorageClient } from '@storage-kernel/provider-local-filesystem';
defineClientContractTests('local filesystem', {
async createClient() {
return createLocalFilesystemStorageClient({
location: {
directory: './tmp/storage-tests',
},
});
},
});The helper validates common behavior such as text and binary IO, streams, overwrite handling, deletion, directory listing, metadata and native copy.
License
MIT
