mirror of https://github.com/sbt/sbt.git
A bit more reliable Scala JS file reading in tests
Was sometimes getting undefined error locally
This commit is contained in:
parent
5f74d7982b
commit
06d0e4fac3
|
|
@ -15,7 +15,7 @@ package object compatibility {
|
|||
|
||||
fs.readFile("tests/shared/src/test/resources/" + path, "utf-8", {
|
||||
(err: js.Dynamic, data: js.Dynamic) =>
|
||||
if (err == null) p.success(data.asInstanceOf[String])
|
||||
if (js.isUndefined(err) || err == null) p.success(data.asInstanceOf[String])
|
||||
else p.failure(new Exception(err.toString))
|
||||
()
|
||||
}: js.Function2[js.Dynamic, js.Dynamic, Unit])
|
||||
|
|
|
|||
Loading…
Reference in New Issue