Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sebpiq committed Apr 5, 2024
1 parent d70fd57 commit b87a34e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
20 changes: 18 additions & 2 deletions src/compile/precompile/dependencies.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,14 @@ describe('precompile.dependencies', () => {
ast`"bli"`,
ast`"blu"`,
]),
exports: [],
exports: [
{
name: 'commons_getArray',
},
{
name: 'commons_setArray',
},
],
imports: [],
}
)
Expand Down Expand Up @@ -144,7 +151,16 @@ describe('precompile.dependencies', () => {

assert.deepStrictEqual<PrecompiledCode['dependencies']['exports']>(
precompilation.precompiledCode.dependencies.exports,
[{ name: 'ble' }, { name: 'blo' }]
[
{
name: 'commons_getArray',
},
{
name: 'commons_setArray',
},
{ name: 'ble' },
{ name: 'blo' },
]
)
assert.deepStrictEqual<PrecompiledCode['dependencies']['imports']>(
precompilation.precompiledCode.dependencies.imports,
Expand Down
8 changes: 4 additions & 4 deletions src/compile/render/templates.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ describe('templates', () => {
Sequence([
Func('N_n1_rcvs_0', [
Var('Message', 'm'),
])`// [n1] message receiver 0\nthrow new Error('Node "n1", inlet "0", unsupported message : ' + msg_display(m))`,
])`// [n1] message receiver 0\nthrow new Error('Node type "DUMMY", id "n1", inlet "0", unsupported message : ' + msg_display(m))`,
Func('N_n1_rcvs_1', [
Var('Message', 'm'),
])`// [n1] message receiver 1\nthrow new Error('Node "n1", inlet "1", unsupported message : ' + msg_display(m))`,
])`// [n1] message receiver 1\nthrow new Error('Node type "DUMMY", id "n1", inlet "1", unsupported message : ' + msg_display(m))`,
Func('N_n2_rcvs_0', [
Var('Message', 'm'),
])`// [n2] message receiver 0\nthrow new Error('Node "n2", inlet "0", unsupported message : ' + msg_display(m))`,
])`// [n2] message receiver 0\nthrow new Error('Node type "DUMMY", id "n2", inlet "0", unsupported message : ' + msg_display(m))`,
])
)
})
Expand Down Expand Up @@ -164,7 +164,7 @@ describe('templates', () => {
Sequence([
Func('N_n1_rcvs_0', [
Var('Message', 'm'),
])`// [n1] message receiver 0\nthrow new Error('Node "n1", inlet "0", unsupported message : ' + msg_display(m) + '\\nDEBUG : remember, you must return from message receiver')`,
])`// [n1] message receiver 0\nthrow new Error('Node type "DUMMY", id "n1", inlet "0", unsupported message : ' + msg_display(m) + '\\nDEBUG : remember, you must return from message receiver')`,
])
)
})
Expand Down
2 changes: 1 addition & 1 deletion src/engine.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@ describe('Engine', () => {
await expect(() =>
engine.io.messageReceivers.someNode!.someInlet!([123, 'bla'])
).toThrow(
/Node "someNode", inlet "someInlet", unsupported message : \[123(.0)*, "bla"\]( at [0-9]+:[0-9]+)?/
/Node type \"someNodeType\", id "someNode", inlet "someInlet", unsupported message : \[123(.0)*, "bla"\]( at [0-9]+:[0-9]+)?/
)
}
)
Expand Down

0 comments on commit b87a34e

Please sign in to comment.