@specific.dev/spectest 0.13.0 → 0.14.0

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": "@specific.dev/spectest",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Spectest SDK for defining test environments in TypeScript.",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -31,6 +31,12 @@ export {
31
31
  type ExpoOptions,
32
32
  type ExpoHelpers,
33
33
  } from "./expo.js";
34
+ export {
35
+ supabase,
36
+ type SupabaseOptions,
37
+ type SupabaseHelpers,
38
+ type SupabaseStack,
39
+ } from "./supabase.js";
34
40
  export {
35
41
  replayFake,
36
42
  type ReplayFakeOptions,
@@ -18,7 +18,7 @@ import {
18
18
  } from "@kubernetes/client-node";
19
19
  import { Observable } from "@kubernetes/client-node/dist/gen/rxjsStub.js";
20
20
 
21
- import type { ServiceDefinition } from "../index.js";
21
+ import type { ServiceDefinition, ServiceHelpersContext } from "../index.js";
22
22
  import { dnsName, provides, SELF_SERVICE_TOKEN } from "../index.js";
23
23
  import { readRaw, readTag, wrap } from "../inspect.js";
24
24
  import type { Wrapped } from "../inspect.js";
@@ -180,13 +180,6 @@ function runProcess(
180
180
  });
181
181
  }
182
182
 
183
- function runDocker(
184
- args: string[],
185
- timeoutMs = 30_000,
186
- ): Promise<DockerExecResult> {
187
- return runProcess("docker", args, timeoutMs);
188
- }
189
-
190
183
  // In-VM root CA, generated once into the base snapshot (see
191
184
  // control-plane `base.rs`). Trusted everywhere the test framework runs —
192
185
  // Node (`NODE_EXTRA_CA_CERTS`), Chromium (NSS DB), Python, the system
@@ -1242,19 +1235,14 @@ export function k3s(opts: K3sOptions = {}) {
1242
1235
  ingressDomains,
1243
1236
  });
1244
1237
  },
1245
- helpers: async ({ name }: { name: string }): Promise<K3sHelpers> => {
1238
+ helpers: async ({ name, exec }: ServiceHelpersContext): Promise<K3sHelpers> => {
1246
1239
  // Read the cluster's kubeconfig and address the API server by its
1247
1240
  // auto-assigned `<name>.internal` hostname on spectest-net. TLS
1248
1241
  // verification is off (see the K3sHelpers docstring), so the
1249
1242
  // server's cert SAN list doesn't need to include the .internal
1250
1243
  // name.
1251
- const kcRead = await runDocker([
1252
- "exec",
1253
- name,
1254
- "cat",
1255
- "/etc/rancher/k3s/k3s.yaml",
1256
- ]);
1257
- if (kcRead.code !== 0) {
1244
+ const kcRead = await exec(name, ["cat", "/etc/rancher/k3s/k3s.yaml"]);
1245
+ if (kcRead.exitCode !== 0) {
1258
1246
  throw new Error(
1259
1247
  `k3s(${name}): failed to read kubeconfig from container: ${kcRead.stderr.trim()}`,
1260
1248
  );