File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
jsdom-nodejs-env/src/test/scala/org/scalajs/jsenv/jsdomnodejs Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,12 @@ import org.scalajs.jsenv.test._
12
12
13
13
class JSDOMNodeJSEnvTest {
14
14
15
+ private val TestRunConfig = {
16
+ RunConfig ()
17
+ .withInheritOut(false )
18
+ .withOnOutputStream((_, _) => ()) // ignore stdout
19
+ }
20
+
15
21
private val config = JSDOMNodeJSSuite .Config
16
22
private val kit = new TestKit (config, withCom = true )
17
23
import kit ._
@@ -27,4 +33,25 @@ class JSDOMNodeJSEnvTest {
27
33
|""" .stripMargin
28
34
}
29
35
36
+ @ Test
37
+ def historyAPIWithoutTestKit : Unit = {
38
+ assertRunSucceeds(
39
+ """
40
+ |console.log(window.location.href);
41
+ |window.history.pushState({}, "", "/foo");
42
+ |console.log(window.location.href);
43
+ """ .stripMargin)
44
+ }
45
+
46
+ private def assertRunSucceeds (inputStr : String ): Unit = {
47
+ val inputFile = MemVirtualBinaryFile .fromStringUTF8(" test.js" , inputStr)
48
+ val input = Input .ScriptsToLoad (List (inputFile))
49
+ val run = config.jsEnv.start(input, TestRunConfig )
50
+ try {
51
+ Await .result(run.future, config.awaitTimeout)
52
+ } finally {
53
+ run.close()
54
+ }
55
+ }
56
+
30
57
}
You can’t perform that action at this time.
0 commit comments