@soiljs/spi 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +150 -2
- package/dist/chunk-6VZ7CJCJ.js +117 -0
- package/dist/chunk-6VZ7CJCJ.js.map +1 -0
- package/dist/index.d.ts +140 -0
- package/dist/index.js +345 -0
- package/dist/index.js.map +1 -0
- package/dist/storage-COwm2B68.d.ts +676 -0
- package/dist/testing/index.d.ts +30 -0
- package/dist/testing/index.js +1091 -0
- package/dist/testing/index.js.map +1 -0
- package/package.json +38 -3
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { am as StorageAdapter } from '../storage-COwm2B68.js';
|
|
2
|
+
|
|
3
|
+
/** Minimal structural API compatible with Vitest, without importing it at runtime. */
|
|
4
|
+
interface StorageContractAssertions {
|
|
5
|
+
toBe(expected: unknown): void;
|
|
6
|
+
toEqual(expected: unknown): void;
|
|
7
|
+
toBeInstanceOf(expected: abstract new (...args: never[]) => unknown): void;
|
|
8
|
+
toBeGreaterThan(expected: number): void;
|
|
9
|
+
}
|
|
10
|
+
interface StorageContractHarness {
|
|
11
|
+
describe(name: string, body: () => void): unknown;
|
|
12
|
+
it(name: string, body: () => void | Promise<void>): unknown;
|
|
13
|
+
expect(actual: unknown): StorageContractAssertions;
|
|
14
|
+
beforeEach(body: () => void | Promise<void>): unknown;
|
|
15
|
+
afterEach(body: () => void | Promise<void>): unknown;
|
|
16
|
+
}
|
|
17
|
+
/** Must return a fresh isolated backend for each test; close must release its resources. */
|
|
18
|
+
type StorageContractFactory = () => StorageAdapter | Promise<StorageAdapter>;
|
|
19
|
+
interface StorageContractOptions {
|
|
20
|
+
/** For injected backend clocks. Otherwise the lease test uses real timers. */
|
|
21
|
+
advanceTime?: (milliseconds: number) => void | Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Registers all nine suites. No adapter or runner implementation is bundled.
|
|
25
|
+
* The full contract requires pruneUnreferenced; an absent optional maintenance
|
|
26
|
+
* capability fails group 9 explicitly rather than silently skipping coverage.
|
|
27
|
+
*/
|
|
28
|
+
declare function runStorageContractTests(name: string, factory: StorageContractFactory, harness: StorageContractHarness, options?: StorageContractOptions): void;
|
|
29
|
+
|
|
30
|
+
export { type StorageContractAssertions, type StorageContractFactory, type StorageContractHarness, type StorageContractOptions, runStorageContractTests };
|