@glassly/miniapp-cli 0.1.17-dev.1 → 0.1.17-dev.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glassly/miniapp-cli",
3
- "version": "0.1.17-dev.1",
3
+ "version": "0.1.17-dev.2",
4
4
  "description": "Build tooling for Glassly miniapps: dev server, packer, manifest validation, and JSON Schema. The `glassly` command that drives it ships in @glassly/cli.",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1,6 +1,6 @@
1
1
  /// <reference types="bun-types" />
2
2
 
3
- import {expect, mock, test} from "bun:test"
3
+ import {afterAll, expect, mock, test} from "bun:test"
4
4
  import {mkdtempSync} from "fs"
5
5
  import {tmpdir} from "os"
6
6
  import {join, resolve} from "path"
@@ -12,8 +12,13 @@ import {createSimStorage} from "./storage.js"
12
12
 
13
13
  // A stand-in background that connects, then draws on the schedule each test sets.
14
14
  let schedule: (draw: () => void) => () => void = () => () => {}
15
- mock.module(resolve(import.meta.dir, "../dev.ts"), () => ({runBuild: async () => {}}))
16
- mock.module(resolve(import.meta.dir, "sim.ts"), () => ({
15
+ const devPath = resolve(import.meta.dir, "../dev.ts")
16
+ const simPath = resolve(import.meta.dir, "sim.ts")
17
+ const realDev = {...(await import(devPath))}
18
+ const realSim = {...(await import(simPath))}
19
+ mock.module(devPath, () => ({...realDev, runBuild: async () => {}}))
20
+ mock.module(simPath, () => ({
21
+ ...realSim,
17
22
  readManifest: () => ({name: "Fixture", packageName: "com.example.fixture", entry: {background: "unused.js"}}),
18
23
  loadHostModules: async () => ({
19
24
  SimHost,
@@ -33,6 +38,10 @@ mock.module(resolve(import.meta.dir, "sim.ts"), () => ({
33
38
  }),
34
39
  }))
35
40
  const {simShots} = await import("./shots.js")
41
+ afterAll(() => {
42
+ mock.module(devPath, () => realDev)
43
+ mock.module(simPath, () => realSim)
44
+ })
36
45
  const out = () => mkdtempSync(join(tmpdir(), "glassly-shots-test-"))
37
46
 
38
47
  test("a first frame drawn after the quiet interval is still waited for", async () => {