@lunora/testing 1.0.0-alpha.4 → 1.0.0-alpha.40
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.md +6 -0
- package/README.md +12 -0
- package/__assets__/package-og.svg +1 -1
- package/dist/index.d.mts +25 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/{lunoraTest-BUg4Ebv8.mjs → lunoraTest-C0DZz2W9.mjs} +104 -46
- package/package.json +6 -5
package/LICENSE.md
CHANGED
|
@@ -103,3 +103,9 @@ Unless required by applicable law or agreed to in writing, software distributed
|
|
|
103
103
|
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
104
|
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
105
|
specific language governing permissions and limitations under the License.
|
|
106
|
+
|
|
107
|
+
<!-- DEPENDENCIES -->
|
|
108
|
+
<!-- /DEPENDENCIES -->
|
|
109
|
+
|
|
110
|
+
<!-- TYPE_DEPENDENCIES -->
|
|
111
|
+
<!-- /TYPE_DEPENDENCIES -->
|
package/README.md
CHANGED
|
@@ -116,6 +116,18 @@ const t = lunoraTest(schema, { fetch: fakeFetch });
|
|
|
116
116
|
|
|
117
117
|
Without the option, `ctx.fetch` still throws the v1 error on first access.
|
|
118
118
|
|
|
119
|
+
#### Fixed `ctx.now`
|
|
120
|
+
|
|
121
|
+
Pass a `now` option (epoch ms) to pin `ctx.now` across every context, so
|
|
122
|
+
time-dependent handlers are deterministic:
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
const t = lunoraTest(schema, { now: 1_700_000_000_000 });
|
|
126
|
+
// ctx.now === 1_700_000_000_000 in every query/mutation/action
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Defaults to the wall clock captured at harness creation.
|
|
130
|
+
|
|
119
131
|
#### Controllable in-memory scheduler
|
|
120
132
|
|
|
121
133
|
`ctx.scheduler` is a fully functional fake. Jobs are enqueued synchronously but
|