From 836b7957513ef5a7b249efd250303e219d039dfc Mon Sep 17 00:00:00 2001 From: Glen Whitney Date: Tue, 22 Feb 2022 07:44:20 -0800 Subject: [PATCH] chore: Add test to ensure the defined property of FunctionNode is exported --- test/generated-code-tests/entry/mainAny.test.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/generated-code-tests/entry/mainAny.test.js b/test/generated-code-tests/entry/mainAny.test.js index 4c7bcc9216..3f832a92bb 100644 --- a/test/generated-code-tests/entry/mainAny.test.js +++ b/test/generated-code-tests/entry/mainAny.test.js @@ -2,7 +2,7 @@ import assert from 'assert' import * as mainAny from '../../../src/entry/mainAny.js' import * as factoriesAny from '../../../src/factoriesAny.js' import { createSnapshotFromFactories, validateBundle, validateTypeOf } from '../../../src/utils/snapshot.js' -const { create, all, add, matrix, isObject, isMatrix, pi, speedOfLight, sqrt, evaluate, chain, reviver, Complex, addDependencies } = mainAny +const { create, all, add, matrix, isObject, isMatrix, pi, speedOfLight, sqrt, evaluate, chain, reviver, Complex, FunctionNode, SymbolNode, ConstantNode, addDependencies } = mainAny const { expectedInstanceStructure, @@ -146,6 +146,14 @@ describe('mainAny', function () { assert.deepStrictEqual(obj, c) }) + it('should have the full FunctionNode interface', () => { + const funcname = 'myfunc' + const myfunc = + new FunctionNode( + new SymbolNode(funcname), [new ConstantNode(2), new ConstantNode(3)]) + assert.strictEqual(myfunc.name, funcname) + }) + // TODO: test export of errors // TODO: test export of classes })