diff --git a/view/tree2/to/js/test/ex/array_number.view.tree b/view/tree2/to/js/test/ex/array_number.view.tree index 095434605d4..239b9419ee5 100644 --- a/view/tree2/to/js/test/ex/array_number.view.tree +++ b/view/tree2/to/js/test/ex/array_number.view.tree @@ -1,6 +1,6 @@ $mol_view_tree2_to_js_test_ex_array_number_foo $mol_object bar / - - NaN + -NaN -Infinity +Infinity 0 diff --git a/view/tree2/to/js/test/js.array.test.ts b/view/tree2/to/js/test/js.array.test.ts index dedbc2481a9..0436a298560 100644 --- a/view/tree2/to/js/test/js.array.test.ts +++ b/view/tree2/to/js/test/js.array.test.ts @@ -22,7 +22,7 @@ namespace $ { $mol_assert_like( foo.bar(), [ - // Number.NaN, + Number.NaN, Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY, 0, diff --git a/view/tree2/to/js/test/run.ts b/view/tree2/to/js/test/run.ts index 13ccd27fbc8..81177fc1c62 100644 --- a/view/tree2/to/js/test/run.ts +++ b/view/tree2/to/js/test/run.ts @@ -1,6 +1,6 @@ namespace $ { - const str2js_dts = (function (this: $, data: string, url: string) { + const str2js = (function (this: $, data: string, url: string) { const tree = this.$mol_tree2_from_string(data, url) const js_tree = this.$mol_view_tree2_to_js(tree) const js_text = this.$mol_tree2_js_to_text(js_tree) @@ -8,25 +8,13 @@ namespace $ { return js_str }).bind($ as typeof $$) - function $mol_view_tree2_to_js_test_id(stack_index = 1, no_prefix = false) { - const name = new Error('').stack - ?.split('\n').at(stack_index + 1)?.match(/ at (.*) \(/) - ?.[1].toLowerCase().replace(/[ .]/g, '_') ?? '' - - if (no_prefix) return name - - return '$mol_view_tree2_to_js_test_ex_' + name - } - export function $mol_view_tree2_to_js_test_run( tree: string ): any { class $mol_view_mock extends $mol_object {} const $ = { $mol_object: $mol_view_mock } ;( $mol_view_mock as any )[$mol_ambient_ref] = $ - const name = $mol_view_tree2_to_js_test_id(2, true) - - const src_uri = `${name}.view.tree` - const js = str2js_dts( tree, src_uri ) + const src_uri = `.view.tree` + const js = str2js( tree, src_uri ) eval( js ) return $