Skip to content

Commit 836b795

Browse files
committed
chore: Add test to ensure the defined property of FunctionNode is exported
1 parent 8ba396d commit 836b795

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/generated-code-tests/entry/mainAny.test.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import assert from 'assert'
22
import * as mainAny from '../../../src/entry/mainAny.js'
33
import * as factoriesAny from '../../../src/factoriesAny.js'
44
import { createSnapshotFromFactories, validateBundle, validateTypeOf } from '../../../src/utils/snapshot.js'
5-
const { create, all, add, matrix, isObject, isMatrix, pi, speedOfLight, sqrt, evaluate, chain, reviver, Complex, addDependencies } = mainAny
5+
const { create, all, add, matrix, isObject, isMatrix, pi, speedOfLight, sqrt, evaluate, chain, reviver, Complex, FunctionNode, SymbolNode, ConstantNode, addDependencies } = mainAny
66

77
const {
88
expectedInstanceStructure,
@@ -146,6 +146,14 @@ describe('mainAny', function () {
146146
assert.deepStrictEqual(obj, c)
147147
})
148148

149+
it('should have the full FunctionNode interface', () => {
150+
const funcname = 'myfunc'
151+
const myfunc =
152+
new FunctionNode(
153+
new SymbolNode(funcname), [new ConstantNode(2), new ConstantNode(3)])
154+
assert.strictEqual(myfunc.name, funcname)
155+
})
156+
149157
// TODO: test export of errors
150158
// TODO: test export of classes
151159
})

0 commit comments

Comments
 (0)