code: def test_nodejs_compile_javascript() -> None:
      assert buc.nodejs_compile(
          """function f(a, b) { return a + b; };""",
          "javascript",
          "some.js",
      ) == dict(
          code="""\
  function f(a, b) { return a + b; }
  ;
  """,
          deps=[],
      )
  
      assert buc.nodejs_compile(
          """const some = require('some/module');""",
          "javascript",
          "some.js",
      ) == dict(
          code="""\
  const some = require('some/module');
  """,
          deps=["some/module"],
      )
  
      assert (
          buc.nodejs_compile(
              """
  const {Model} = require("lib/model");
  
  class MyModel extends Model {
      static __name__ = 'MyModel';
  }
  
  exports.MyModel = MyModel;
  """,
              "javascript",
              "some.js",
          )
          == dict(
              code="""\
  const { Model } = require("lib/model");
  class MyModel extends Model {
      static __name__ = 'MyModel';
  }
  exports.MyModel = MyModel;
  """,
              deps=["lib/model"],
          )
      )
  
      assert buc.nodejs_compile(
          """function f(a, b) { eturn a + b; };""",
          "javascript",
          "some.js",
      ) == dict(
          error="\x1b[96msome.js\x1b[0m:\x1b[93m1\x1b[0m:\x1b[93m20\x1b[0m - "
          "\x1b[91merror\x1b[0m\x1b[90m TS1435: \x1b[0mUnknown keyword or "
          "identifier. Did you mean 'return'?\n"
          "\n"
          "\x1b[7m1\x1b[0m function f(a, b) { eturn a + b; };\n"
          "\x1b[7m \x1b[0m \x1b[91m                   ~~~~~\x1b[0m\n",
      )
  
file_path: bokeh/tests/unit/bokeh/util/test_compiler.py
imports: from __future__ import annotations
  import pytest
  import json
  import os
  from unittest.mock import MagicMock, patch
  import bokeh.util.compiler
label_desc: Use image node_id 1 for calling a global function with example usage: test_nodejs_compile_javascript() without return types