Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Update pinned error text in motion, relation and retarget tests (issue #653)

Nguyen Xuan An0dc68c8dd7cc
diff --git a/tests/agent-asset-retarget.test.js b/tests/agent-asset-retarget.test.js
index de9b7fce..8598da47 100644
--- a/tests/agent-asset-retarget.test.js
+++ b/tests/agent-asset-retarget.test.js
@@ -121,6 +121,6 @@ test('keyed morph weights blink and open the jaw by target name, and seeking rep
target.scene.sampleMotion(0.6);
assert.deepEqual(face(), atBlink, 'seeking back repeats the earlier weights');
assert.deepEqual(hierarchyOf(target).morphTargetNames, FACE_TARGETS);
- await assert.rejects(createTarget({ duration: 1, tracks: [{ kind: 'morph', id: 'cheekPuff', property: 'weight', keyframes: [{ time: 0, value: 1 }] }] }), /motion\.tracks\[0\]\.id: got "cheekPuff"; expected the ID of a morph in this recipe; morph targets of this asset: eyeBlinkLeft/);
+ await assert.rejects(createTarget({ duration: 1, tracks: [{ kind: 'morph', id: 'cheekPuff', property: 'weight', keyframes: [{ time: 0, value: 1 }] }] }), /motion\.tracks\[0\]\.id: got "cheekPuff"; expected the ID of a morph in this recipe, such as "eyeBlinkLeft"; morph targets of this asset: eyeBlinkLeft/);
await assert.rejects(createTarget({ duration: 1, tracks: [{ kind: 'morph', id: 'jawOpen', property: 'weight', keyframes: [{ time: 0, value: 2 }] }] }), /morph weight from 0 to 1/);
});
diff --git a/tests/agent-motion-ik.test.js b/tests/agent-motion-ik.test.js
index 9ab55751..fe9f623f 100644
--- a/tests/agent-motion-ik.test.js
+++ b/tests/agent-motion-ik.test.js
@@ -160,7 +160,7 @@ test('recipes export and reload with their ik', () => {
test('mistakes say what to pass', () => {
const create = (ik, overrides) => createAgentScene(armRecipe({ duration: 1, tracks: [], ik }, overrides));
assert.throws(() => createAgentScene(armRecipe({ duration: 1, tracks: [] })), /at least one track, IK solver, constraint or driver/);
- assert.throws(() => create([{ type: 'fabrik', target: [0, 0, 0] }]), /motion\.ik\[0\]\.type: got "fabrik"; expected "two-bone" or "aim"/);
+ assert.throws(() => create([{ type: 'fabrik', target: [0, 0, 0] }]), /motion\.ik\[0\]\.type: got "fabrik"; expected one of two-bone or aim/);
assert.throws(() => create([armIk([0, 0, 0], { root: 'nope' })]), /motion\.ik\[0\]\.root: got "nope"; expected a node ID in this recipe/);
assert.throws(() => create([armIk({ node: 'nope' })]), /motion\.ik\[0\]\.target\.node: got "nope"; expected a node ID/);
assert.throws(() => create([armIk('here')]), /motion\.ik\[0\]\.target: got "here"; expected \[x, y, z\]/);
diff --git a/tests/part-relations.test.js b/tests/part-relations.test.js
index 13f3475b..25ce8c6e 100644
--- a/tests/part-relations.test.js
+++ b/tests/part-relations.test.js
@@ -136,7 +136,7 @@ test('cycles, unknown parts and self references are rejected with the next actio
], /relations\[0\]\.to: got "ghost"; expected the ID of a node in this recipe; list them with scene_inspect/);
rejects([
{ id: 'a', relations: [{ kind: 'centered', to: 'a' }] },
- ], /relations\[0\]\.to: got "a"; expected the ID of another part, not its own node/);
+ ], /relations\[0\]\.to: got "a"; expected the ID of another part, such as "body", not its own node/);
rejects([
{ id: 'a', relations: [{ kind: 'attach', to: 'loop', side: '+x' }] },
{ id: 'a2', relations: [{ kind: 'attach', to: 'a', side: '+x' }] },
@@ -154,7 +154,7 @@ test('a part cannot be placed against its own child, which would move with it',
test('group nodes, group targets and two relations on one axis are rejected', () => {
const noGeometry = recipeWith([{ id: 'g' }, { id: 'a', relations: [{ kind: 'centered', to: 'g' }] }]);
noGeometry.nodes[0] = { id: 'g' };
- assert.throws(() => createAgentScene(noGeometry), /relations\[0\]\.to: got "g"; expected the ID of a mesh node, since this one is a group with no geometry/);
+ assert.throws(() => createAgentScene(noGeometry), /relations\[0\]\.to: got "g"; expected the ID of a mesh node, such as a box, since this one is a group with no geometry/);
noGeometry.nodes[0] = { id: 'g', geometry: 'cube', material: 'grey' };
noGeometry.nodes[1] = { id: 'a', relations: [{ kind: 'centered', to: 'g' }] };
assert.throws(() => createAgentScene(noGeometry), /nodes\[1\]\.relations: got .*; expected relations on a mesh node, since this node is a group/);