Skip to content
2 min read · 376 words

Interface: ConformanceMutations

Defined in: src/batteries/sandbox/conformance/index.ts:42

Optional mutation fixture for adapters that expose filesystem mutators.

Methods

delete()?

ts
optional delete(path: string): Promise<void>;

Defined in: src/batteries/sandbox/conformance/index.ts:54

Remove a fixture; the optional operation must also resolve when the path is already absent.

Parameters

ParameterType
pathstring

Returns

Promise<void>


freePath()

ts
freePath(options?: {
  directory?: "default" | "other";
}): Promise<string>;

Defined in: src/batteries/sandbox/conformance/index.ts:46

A fresh absent path with an existing parent, allowing rename checks without requiring mkdir.

Parameters

ParameterType
options?{ directory?: "default" | "other"; }
options.directory?"default" | "other"

Returns

Promise<string>


makeFile()

ts
makeFile(text: string, options?: {
  directory?: "default" | "other";
}): Promise<string>;

Defined in: src/batteries/sandbox/conformance/index.ts:44

A fresh disposable path in the selected existing directory, so checks cannot collide with repository files.

Parameters

ParameterType
textstring
options?{ directory?: "default" | "other"; }
options.directory?"default" | "other"

Returns

Promise<string>


mkdir()?

ts
optional mkdir(path: string): Promise<void>;

Defined in: src/batteries/sandbox/conformance/index.ts:58

Create the requested directory hierarchy and accept an already-existing directory.

Parameters

ParameterType
pathstring

Returns

Promise<void>


read()

ts
read(path: string): Promise<string>;

Defined in: src/batteries/sandbox/conformance/index.ts:50

Read fixture content after a mutation, proving that the operation preserved or wrote the expected text.

Parameters

ParameterType
pathstring

Returns

Promise<string>


rename()?

ts
optional rename(from: string, to: string): Promise<void>;

Defined in: src/batteries/sandbox/conformance/index.ts:56

Move a fixture and overwrite an existing destination, matching the filesystem contract.

Parameters

ParameterType
fromstring
tostring

Returns

Promise<void>


stat()

ts
stat(path: string): Promise<{
  kind: string;
  size: number;
  version: string;
}>;

Defined in: src/batteries/sandbox/conformance/index.ts:48

Observe the post-mutation metadata, including entry kind for directory checks.

Parameters

ParameterType
pathstring

Returns

Promise<{ kind: string; size: number; version: string; }>


write()

ts
write(path: string, text: string): Promise<void>;

Defined in: src/batteries/sandbox/conformance/index.ts:52

Replace fixture content and make the new text observable through a subsequent read.

Parameters

ParameterType
pathstring
textstring

Returns

Promise<void>