diff --git a/tests/globals/typeof.luau b/tests/globals/typeof.luau index 6cbf198..f42defe 100644 --- a/tests/globals/typeof.luau +++ b/tests/globals/typeof.luau @@ -1,3 +1,6 @@ +-- NOTE: luau-lsp warns without this for the roblox types below +--!nolint UnknownType + local task = require("@lune/task") local function f() end @@ -14,3 +17,13 @@ assert( assert(typeof(thread2) == "thread", "Calling typeof() did not return 'thread' after task.spawn") assert(typeof(thread3) == "thread", "Calling typeof() did not return 'thread' after task.defer") assert(typeof(thread4) == "thread", "Calling typeof() did not return 'thread' after delay") + +local roblox = require("@lune/roblox") + +local rbx1 = roblox.Instance.new("Part") +local rbx2 = (roblox :: any).Vector3.zero +local rbx3 = (roblox :: any).Enum.KeyCode.A + +assert(typeof(rbx1) == "Instance", "Calling typeof() did not return 'Instance' for Instance.new") +assert(typeof(rbx2) == "Vector3", "Calling typeof() did not return 'Vector3' for Vector3.zero") +assert(typeof(rbx3) == "EnumItem", "Calling typeof() did not return 'EnumItem' for Enum.KeyCode.A")