@ripplo/testing 0.5.5 → 0.5.6

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.
Files changed (2) hide show
  1. package/dist/lockfile.js +18 -3
  2. package/package.json +3 -3
package/dist/lockfile.js CHANGED
@@ -611,6 +611,12 @@ async function hashFixturesIntoCompileResult({
611
611
  return { ...result, fixtures: Object.fromEntries(hashed) };
612
612
  }
613
613
  async function hashOneFixture({ fixturesRoot, name }) {
614
+ const rawName = name;
615
+ if (typeof rawName !== "string" || rawName.length === 0) {
616
+ throw new Error(
617
+ `Internal error: upload step produced a non-string fixture name (got ${rawName === null ? "null" : typeof rawName}). This usually means a test passed a non-Fixture value to upload() \u2014 wrap the filename with fixture("file.png").`
618
+ );
619
+ }
614
620
  if (name.includes("..") || path.isAbsolute(name)) {
615
621
  throw new Error(`Invalid fixture name "${name}": must be a path under .ripplo/fixtures/`);
616
622
  }
@@ -634,10 +640,19 @@ async function hashOneFixture({ fixturesRoot, name }) {
634
640
  function collectFixtureReferences(result) {
635
641
  const names = /* @__PURE__ */ new Set();
636
642
  result.tests.forEach((test) => {
637
- Object.values(test.spec.nodes).forEach((node) => {
638
- if (node.type === "upload") {
639
- node.files.forEach((name) => names.add(name));
643
+ Object.entries(test.spec.nodes).forEach(([stepId, node]) => {
644
+ if (node.type !== "upload") {
645
+ return;
640
646
  }
647
+ node.files.forEach((name, i) => {
648
+ const raw = name;
649
+ if (typeof raw !== "string" || raw.length === 0) {
650
+ throw new Error(
651
+ `Test "${test.slug}" step "${stepId}" upload files[${String(i)}] is not a non-empty string (got ${raw === null ? "null" : typeof raw}). Wrap filenames with fixture(): upload(loc, fixture("file.png")).`
652
+ );
653
+ }
654
+ names.add(raw);
655
+ });
641
656
  });
642
657
  });
643
658
  return names;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ripplo/testing",
3
3
  "description": "TypeScript DSL for defining and running Ripplo e2e workflow tests",
4
- "version": "0.5.5",
4
+ "version": "0.5.6",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -99,8 +99,8 @@
99
99
  "tsup": "^8.5.1",
100
100
  "typescript": "catalog:",
101
101
  "vitest": "^4.1.4",
102
- "@ripplo/spec": "^0.0.0",
103
- "@ripplo/eslint-config": "0.0.0"
102
+ "@ripplo/eslint-config": "0.0.0",
103
+ "@ripplo/spec": "^0.0.0"
104
104
  },
105
105
  "peerDependencies": {
106
106
  "@nestjs/common": "^10.0.0 || ^11.0.0",