@effected/templates 0.14.0 → 0.14.1
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/ManagedSection.js +16 -13
- package/index.d.ts +3 -2
- package/package.json +1 -1
package/ManagedSection.js
CHANGED
|
@@ -126,9 +126,11 @@ const make = (options = {}) => Effect.gen(function* () {
|
|
|
126
126
|
})
|
|
127
127
|
};
|
|
128
128
|
});
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
/**
|
|
130
|
+
* An unstubbed `makeTest` member: dies when its effect runs, never when it is
|
|
131
|
+
* called, so building the effect outside a generator cannot throw.
|
|
132
|
+
*/
|
|
133
|
+
const unstubbed = (member) => () => Effect.die(/* @__PURE__ */ new Error(`ManagedSection.makeTest: ${member}() was called but not stubbed — pass a \`${member}\` override.`));
|
|
132
134
|
/**
|
|
133
135
|
* Managed sections in files: read, compare, sync and remove delimited blocks
|
|
134
136
|
* whose surrounding content belongs to the user.
|
|
@@ -181,18 +183,19 @@ var ManagedSection = class ManagedSection extends Context.Service()("@effected/t
|
|
|
181
183
|
*/
|
|
182
184
|
static layerWith = (options) => Layer.effect(ManagedSection, make(options));
|
|
183
185
|
/**
|
|
184
|
-
* A test double. Members a suite does not stub **die when
|
|
185
|
-
* than returning a plausible-looking
|
|
186
|
+
* A test double. Members a suite does not stub **die when run** (calling
|
|
187
|
+
* one only builds the effect), rather than returning a plausible-looking
|
|
188
|
+
* answer that makes a wrong test pass.
|
|
186
189
|
*/
|
|
187
190
|
static makeTest = (overrides = {}) => ({
|
|
188
|
-
read: (
|
|
189
|
-
readAll: (
|
|
190
|
-
isManaged: (
|
|
191
|
-
sync: (
|
|
192
|
-
syncAll: (
|
|
193
|
-
check: (
|
|
194
|
-
checkAll: (
|
|
195
|
-
remove: (
|
|
191
|
+
read: unstubbed("read"),
|
|
192
|
+
readAll: unstubbed("readAll"),
|
|
193
|
+
isManaged: unstubbed("isManaged"),
|
|
194
|
+
sync: unstubbed("sync"),
|
|
195
|
+
syncAll: unstubbed("syncAll"),
|
|
196
|
+
check: unstubbed("check"),
|
|
197
|
+
checkAll: unstubbed("checkAll"),
|
|
198
|
+
remove: unstubbed("remove"),
|
|
196
199
|
...overrides
|
|
197
200
|
});
|
|
198
201
|
/**
|
package/index.d.ts
CHANGED
|
@@ -802,8 +802,9 @@ export declare class ManagedSection extends ManagedSection_base {
|
|
|
802
802
|
*/
|
|
803
803
|
static readonly layerWith: (options: ManagedSectionOptions) => Layer.Layer<ManagedSection, never, FileSystem.FileSystem>;
|
|
804
804
|
/**
|
|
805
|
-
* A test double. Members a suite does not stub **die when
|
|
806
|
-
* than returning a plausible-looking
|
|
805
|
+
* A test double. Members a suite does not stub **die when run** (calling
|
|
806
|
+
* one only builds the effect), rather than returning a plausible-looking
|
|
807
|
+
* answer that makes a wrong test pass.
|
|
807
808
|
*/
|
|
808
809
|
static readonly makeTest: (overrides?: Partial<ManagedSectionShape>) => ManagedSectionShape;
|
|
809
810
|
/**
|