forked from scalajs-io/nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hotfix/test_fixes' into develop
* hotfix/test_fixes: Test fixes
- Loading branch information
Showing
12 changed files
with
117 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ import io.scalajs.collection.Iterator | |
import io.scalajs.dom.USVString | ||
|
||
import scala.scalajs.js | ||
import scala.scalajs.js.annotation.JSName | ||
import scala.scalajs.js.| | ||
|
||
/** | ||
|
@@ -16,6 +17,7 @@ import scala.scalajs.js.| | |
* @author [email protected] | ||
*/ | ||
@js.native | ||
@JSName("URLSearchParams") | ||
class URLSearchParams(init: USVString | URLSearchParams) extends js.Object { | ||
|
||
///////////////////////////////////////////////////////////////////////////////// | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
package io.scalajs.dom.html | ||
|
||
import io.scalajs.dom.html.browser.console | ||
import io.scalajs.util.ScalaJsHelper._ | ||
import org.scalatest.FunSpec | ||
|
||
import scala.scalajs.js | ||
|
||
/** | ||
* URL Search Params Test | ||
* @author [email protected] | ||
|
@@ -12,11 +15,14 @@ class URLSearchParamsTest extends FunSpec { | |
describe("URLSearchParams") { | ||
|
||
it("should provide an iteration of values") { | ||
val searchParams = new URLSearchParams("key1=value1&key2=value2") | ||
// only if URLSearchParams is supported | ||
if (isDefined(js.Dynamic.global.URLSearchParams)) { | ||
val searchParams = new URLSearchParams("key1=value1&key2=value2") | ||
|
||
// Display the key/value pairs | ||
for (value <- searchParams.values()) { | ||
console.log(value) | ||
// Display the key/value pairs | ||
for (value <- searchParams.values()) { | ||
console.log(value) | ||
} | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
package io.scalajs | ||
|
||
import scala.scalajs.js | ||
|
||
/** | ||
* jquery package object | ||
* @author [email protected] | ||
|
@@ -11,4 +13,18 @@ package object jquery { | |
*/ | ||
type Selector = String | ||
|
||
|
||
/** | ||
* JQuery Enrichment | ||
* @param element the given [[JQueryElement]] | ||
*/ | ||
implicit class JQueryEnrichment(val element: JQueryElement) extends AnyVal { | ||
|
||
@inline | ||
def attr(name: String, function: (Int, String) => String): element.type = { | ||
element.attr(name, function: js.Function2[Int, String, String]) | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
package io.scalajs.nodejs | ||
package child_process | ||
|
||
import io.scalajs.nodejs.buffer.Buffer | ||
import io.scalajs.util.ScalaJsHelper._ | ||
import org.scalatest.FunSpec | ||
|
||
import scala.scalajs.js.| | ||
|
||
/** | ||
* ChildProcess Test | ||
* @author [email protected] | ||
|
@@ -13,7 +16,7 @@ class ChildProcessTest extends FunSpec { | |
describe("ChildProcess") { | ||
|
||
it("supports exec(...)") { | ||
ChildProcess.exec("cat ./package.json | wc -l", (error, stdout, stderr) => { | ||
ChildProcess.exec("cat ./package.json | wc -l", (error: Error, stdout: Buffer | String, stderr: Buffer | String) => { | ||
if (isDefined(error)) { | ||
console.error(s"exec error: $error") | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.