Skip to content

Commit

Permalink
chore(tests): include test for custom user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
CompeyDev committed Apr 20, 2024
1 parent 358fe3a commit d07168d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/net/request/user_agent.luau
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
local net = require("@lune/net")

local runtime, version = table.unpack(_VERSION:split(" "))
local expectedUserAgent = runtime:lower() .. "/" .. version

local userAgent: string =
net.jsonDecode(net.request("https://www.whatsmyua.info/api/v1/ua").body)[1].ua.rawUa

assert(userAgent == expectedUserAgent, "Expected user agent to be " .. expectedUserAgent)

0 comments on commit d07168d

Please sign in to comment.