forked from sashin/sashinexists
run npm install to generate a package lock
This commit is contained in:
24
node_modules/@weborigami/language/test/runtime/functionResultsMap.test.js
generated
vendored
Normal file
24
node_modules/@weborigami/language/test/runtime/functionResultsMap.test.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { ObjectTree, Tree, scope } from "@weborigami/async-tree";
|
||||
import assert from "node:assert";
|
||||
import { describe, test } from "node:test";
|
||||
import functionResultsMap from "../../src/runtime/functionResultsMap.js";
|
||||
|
||||
describe("functionResultsMap", () => {
|
||||
test("get() invokes functions using scope, returns other values as is", async () => {
|
||||
const parent = new ObjectTree({
|
||||
message: "Hello",
|
||||
});
|
||||
const tree = new ObjectTree({
|
||||
fn: /** @this {import("@weborigami/types").AsyncTree} */ function () {
|
||||
return scope(this).get("message");
|
||||
},
|
||||
string: "string",
|
||||
});
|
||||
tree.parent = parent;
|
||||
const fixture = functionResultsMap(tree);
|
||||
assert.deepEqual(await Tree.plain(fixture), {
|
||||
fn: "Hello",
|
||||
string: "string",
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user