mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 13:04:30 -08:00
fixes
This commit is contained in:
12
test/test.js
12
test/test.js
@@ -2241,14 +2241,16 @@ const y = x()`
|
||||
}),
|
||||
|
||||
test('get_initial_state toplevel not entrypoint', () => {
|
||||
const s = COMMANDS.get_initial_state({
|
||||
files: {
|
||||
const s = test_initial_state(
|
||||
{
|
||||
'' : `import {x} from 'x'; x()`,
|
||||
'x' : `export const x = () => 1; x()`,
|
||||
},
|
||||
entrypoint: '',
|
||||
current_module: 'x',
|
||||
})
|
||||
{
|
||||
entrypoint: '',
|
||||
current_module: 'x',
|
||||
}
|
||||
)
|
||||
assert_equal(s.current_calltree_node.toplevel, true)
|
||||
assert_equal(s.active_calltree_node, null)
|
||||
}),
|
||||
|
||||
@@ -28,13 +28,15 @@ export const assert_code_error = (codestring, error) => {
|
||||
}
|
||||
|
||||
export const test_initial_state = (code, state) => {
|
||||
return COMMANDS.get_initial_state(
|
||||
{
|
||||
...state,
|
||||
files: typeof(code) == 'object' ? code : { '' : code},
|
||||
entrypoint: '',
|
||||
current_module: '',
|
||||
},
|
||||
return COMMANDS.open_run_window(
|
||||
COMMANDS.get_initial_state(
|
||||
{
|
||||
files: typeof(code) == 'object' ? code : { '' : code},
|
||||
entrypoint: '',
|
||||
current_module: '',
|
||||
...state,
|
||||
},
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user