Skip to content

Commit

Permalink
chore: Add test to ensure the defined property of FunctionNode is exp…
Browse files Browse the repository at this point in the history
…orted
  • Loading branch information
gwhitney committed Feb 22, 2022
1 parent 8ba396d commit 836b795
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/generated-code-tests/entry/mainAny.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
})

0 comments on commit 836b795

Please sign in to comment.