@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 CHANGED
@@ -126,9 +126,11 @@ const make = (options = {}) => Effect.gen(function* () {
126
126
  })
127
127
  };
128
128
  });
129
- const unimplemented = (member) => {
130
- throw new Error(`ManagedSection.makeTest: ${member}() was called but not stubbed — pass a \`${member}\` override.`);
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 called**, rather
185
- * than returning a plausible-looking answer that makes a wrong test pass.
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: () => Effect.sync(() => unimplemented("read")),
189
- readAll: () => Effect.sync(() => unimplemented("readAll")),
190
- isManaged: () => Effect.sync(() => unimplemented("isManaged")),
191
- sync: () => Effect.sync(() => unimplemented("sync")),
192
- syncAll: () => Effect.sync(() => unimplemented("syncAll")),
193
- check: () => Effect.sync(() => unimplemented("check")),
194
- checkAll: () => Effect.sync(() => unimplemented("checkAll")),
195
- remove: () => Effect.sync(() => unimplemented("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 called**, rather
806
- * than returning a plausible-looking answer that makes a wrong test pass.
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
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effected/templates",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "private": false,
5
5
  "description": "Managed-section blocks in user-editable files: parse, reconcile, sync and check delimited regions.",
6
6
  "keywords": [