Skip to content

Commit 7a92caa

Browse files
SimonDanischshashi
authored andcommitted
add tests
1 parent d53548d commit 7a92caa

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

test/REQUIRE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ JSExpr
44
IJulia
55
NBInclude 2.0.0
66
NodeJS
7+
HTTP
8+
WebSockets

test/http-tests.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using WebIO
2+
using HTTP, WebSockets
3+
using JSExpr
4+
using Test
5+
6+
@testset "HTTP provider" begin
7+
output = sprint(io-> show(io, MIME"application/webio"(), node(:div, "hi")))
8+
@test occursin("<script> var websocket_url = \"127.0.0.1:8081/webio_websocket/\" </script>", output)
9+
@test occursin("""{"props":{},"nodeType":"DOM","type":"node","instanceArgs":{"namespace":"html","tag":"div"},"children":["hi"]}""", output)
10+
@test WebIO.webio_server_config[] == (url = "127.0.0.1", http_port = 8081, ws_url = "127.0.0.1:8081/webio_websocket/")
11+
@test isassigned(WebIO.singleton_instance)
12+
end

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ end
7373

7474
include("communication.jl")
7575
include("node.jl")
76+
include("http-tests.jl")
7677
include("mux-tests.jl")
7778
include("blink-tests.jl")
7879
include("util-tests.jl")

0 commit comments

Comments
 (0)