code: def test_write_json_to_string() -> None:
      # Tests if it runs if no arg given
      df = pl.DataFrame({"a": [1, 2, 3]})
      expected_str = '{"columns":[{"name":"a","datatype":"Int64","bit_settings":"","values":[1,2,3]}]}'
      assert df.write_json() == expected_str
  
imports: from __future__ import annotations
  import datetime
  import io
  import json
  from collections import OrderedDict
  from io import BytesIO
  from typing import TYPE_CHECKING, Any
  import pytest
  import polars
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 5 for calling a global function with example usage: test_write_json_to_string() without return types