Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #323 from exoego/scalafmt2
Browse files Browse the repository at this point in the history
Update scalafmt to 2.7.4
  • Loading branch information
exoego authored Oct 7, 2020
2 parents 6a9bbc1 + 3944aeb commit 415e8c9
Show file tree
Hide file tree
Showing 129 changed files with 938 additions and 1,875 deletions.
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "2.7.3"
version = "2.7.4"
style = defaultWithAlign
maxColumn = 120
align.openParenDefnSite = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package io.scalajs.nodejs
import scala.scalajs.js
import org.scalatest.funspec.AnyFunSpec

/**
* Assert Test
/** Assert Test
*/
class AssertTest extends AnyFunSpec {
describe("Assert") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import scala.scalajs.js
import scala.scalajs.js.|
import org.scalatest.funspec.AsyncFunSpec

/**
* ChildProcess Test
/** ChildProcess Test
*/
class ChildProcessTest extends AsyncFunSpec {
override implicit val executionContext = ExecutionContext.Implicits.global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import scala.concurrent.{ExecutionContext, Promise}
import scala.scalajs.js
import org.scalatest.funspec.AsyncFunSpec

/**
* DNS Tests
/** DNS Tests
*/
class DNSAsyncTest extends AsyncFunSpec {
private val domain = "google.com"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import io.scalajs.nodejs.TestHelper._
import scala.concurrent.{ExecutionContext, Promise}
import org.scalatest.funspec.AsyncFunSpec

/**
* File System (Fs) Tests
/** File System (Fs) Tests
*/
class FsTest extends AsyncFunSpec {
override implicit val executionContext = ExecutionContext.Implicits.global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ package http
import scala.scalajs.js
import org.scalatest.funspec.AnyFunSpec

/**
* Http Tests
/** Http Tests
*/
class HttpTest extends AnyFunSpec {
describe("Http") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package io.scalajs.nodejs.http
import scala.scalajs.js
import org.scalatest.funspec.AnyFunSpec

/**
* Http Tests
/** Http Tests
*/
class StatusCodeTest extends AnyFunSpec {
describe("Http") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ package io.scalajs.nodejs.net

import org.scalatest.funspec.AnyFunSpec

/**
* Network (Net) Tests
/** Network (Net) Tests
*/
class NetTest extends AnyFunSpec {
describe("Net") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package io.scalajs.nodejs.os
import io.scalajs.nodejs.TestHelper._
import org.scalatest.funspec.AnyFunSpec

/**
* OS Tests
/** OS Tests
*/
class OSTest extends AnyFunSpec {
describe("OS") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import io.scalajs.nodejs.querystring.QueryStringTest.MyParams
import scala.scalajs.js
import org.scalatest.funspec.AnyFunSpec

/**
* Query String Test
/** Query String Test
*/
class QueryStringTest extends AnyFunSpec {
describe("QueryString") {
Expand Down Expand Up @@ -41,8 +40,7 @@ class QueryStringTest extends AnyFunSpec {
}
}

/**
* Query String Test Companion
/** Query String Test Companion
*/
object QueryStringTest {
class MyParams(val foo: String, val bar: String) extends js.Object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import io.scalajs.nodejs.process.Process
import scala.concurrent.{ExecutionContext, Promise}
import org.scalatest.funspec.AsyncFunSpec

/**
* Readline Tests
/** Readline Tests
*/
class ReadlineTest extends AsyncFunSpec {
override implicit val executionContext = ExecutionContext.Implicits.global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ package io.scalajs.nodejs.tty

import org.scalatest.funspec.AnyFunSpec

/**
* TTY Test
/** TTY Test
*/
class TTYTest extends AnyFunSpec {
describe("TTY") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import org.scalatest.funspec.AnyFunSpec

import scala.scalajs.js

/**
* URLObject Tests
/** URLObject Tests
*/
class URLObjectTest extends AnyFunSpec {
describe("URLObject") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import io.scalajs.nodejs.vm.VMTest.{ExpectedData, Sandbox}
import scala.scalajs.js
import org.scalatest.funspec.AnyFunSpec

/**
* VM Tests
/** VM Tests
*/
class VMTest extends AnyFunSpec {
describe("VM") {
Expand Down Expand Up @@ -41,13 +40,11 @@ class VMTest extends AnyFunSpec {
}
}

/**
* VM Test Companion
/** VM Test Companion
*/
object VMTest {

/**
* Sandbox Object
/** Sandbox Object
*/
class Sandbox(var animal: String, var count: Int, var name: String) extends js.Object

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package io.scalajs.nodejs.buffer
import scala.scalajs.js
import org.scalatest.funspec.AnyFunSpec

/**
* Buffer Tests
/** Buffer Tests
*/
class BufferTest extends AnyFunSpec {
it("should support writeBigInt64BE, writeBigInt64LE, writeBigInt64BE and writeBigInt64BE") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import org.scalatest.funspec.AnyFunSpec

import scala.scalajs.js.JavaScriptException

/**
* File System (Fs) Tests
/** File System (Fs) Tests
*/
class FsClassesTest extends AnyFunSpec {
describe("ReadStream") {
Expand Down
39 changes: 13 additions & 26 deletions app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Assert.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package io.scalajs.nodejs
import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport

/**
* The assert module provides a simple set of assertion tests that can be used to test invariants. The module is
/** The assert module provides a simple set of assertion tests that can be used to test invariants. The module is
* intended for internal use by Node.js, but can be used in application code via require('assert'). However, assert
* is not a testing framework, and is not intended to be used as a general purpose assertion library.
*
Expand All @@ -14,16 +13,14 @@ import scala.scalajs.js.annotation.JSImport
@js.native
trait Assert extends js.Object {

/**
* An alias of assert.ok() .
/** An alias of assert.ok() .
* @param expression the expression to evaluate
* @example assert(value[, message])
*/
def apply(expression: js.Any, message: String): Unit = js.native
def apply(expression: js.Any): Unit = js.native

/**
* Generally identical to assert.deepEqual() with two exceptions. First, primitive values are compared using the
/** Generally identical to assert.deepEqual() with two exceptions. First, primitive values are compared using the
* strict equality operator ( === ). Second, object comparisons include a strict equality check of their prototypes.
* @example assert.deepStrictEqual(actual, expected[, message])
*/
Expand All @@ -43,8 +40,7 @@ trait Assert extends js.Object {
def doesNotReject(asyncFn: js.Promise[_], message: String): Unit = js.native
def doesNotReject(asyncFn: js.Promise[_]): Unit = js.native

/**
* Asserts that the function block does not throw an error. See assert.throws() for more details.
/** Asserts that the function block does not throw an error. See assert.throws() for more details.
* When assert.doesNotThrow() is called, it will immediately call the block function. If an error is thrown
* and it is the same type as that specified by the error parameter, then an AssertionError is thrown. If the
* error is of a different type, or if the error parameter is undefined, the error is propagated back to the caller.
Expand All @@ -57,56 +53,48 @@ trait Assert extends js.Object {
def doesNotThrow(block: js.Function, message: String): Unit = js.native
def doesNotThrow(block: js.Function): Unit = js.native

/**
* @see https://nodejs.org/api/assert.html#assert_assert_fail_message
/** @see https://nodejs.org/api/assert.html#assert_assert_fail_message
*/
def fail(message: String): Unit = js.native

/**
* @see https://nodejs.org/api/assert.html#assert_assert_fail_message
/** @see https://nodejs.org/api/assert.html#assert_assert_fail_message
*/
def fail(message: js.Error): Unit = js.native

@deprecated("Use assert.fail([message]) or other assert functions instead.", "Node.js v10.0.0")
def fail(actual: js.Any, expected: js.Any, message: String, operator: String): Unit = js.native

/**
* Throws value if value is truthy. This is useful when testing the error argument in callbacks.
/** Throws value if value is truthy. This is useful when testing the error argument in callbacks.
* @example assert.ifError(value)
*/
def ifError(value: js.Any): Unit = js.native

/**
* Tests for deep strict inequality. Opposite of assert.deepStrictEqual().
/** Tests for deep strict inequality. Opposite of assert.deepStrictEqual().
* @example assert.notDeepStrictEqual(actual, expected[, message])
*/
def notDeepStrictEqual(actual: js.Any, expected: js.Any, message: String): Unit = js.native
def notDeepStrictEqual(actual: js.Any, expected: js.Any): Unit = js.native

/**
* Tests strict inequality as determined by the strict not equal operator ( !== ).
/** Tests strict inequality as determined by the strict not equal operator ( !== ).
* @example assert.notStrictEqual(actual, expected[, message])
*/
def notStrictEqual(actual: js.Any, expected: js.Any, message: String): Unit = js.native
def notStrictEqual(actual: js.Any, expected: js.Any): Unit = js.native

/**
* Tests if value is truthy. It is equivalent to assert.equal(!!value, true, message). If value is not truthy,
/** Tests if value is truthy. It is equivalent to assert.equal(!!value, true, message). If value is not truthy,
* an AssertionError is thrown with a message property set equal to the value of the message parameter. If the
* message parameter is undefined, a default error message is assigned.
*/
def ok(value: js.Any, message: String): Unit = js.native
def ok(value: js.Any): Unit = js.native

/**
* Tests strict equality as determined by the strict equality operator ( === ).
/** Tests strict equality as determined by the strict equality operator ( === ).
* @example assert.strictEqual(actual, expected[, message])
*/
def strictEqual(actual: js.Any, expected: js.Any, message: String): Unit = js.native
def strictEqual(actual: js.Any, expected: js.Any): Unit = js.native

/**
* If the values are not strictly equal, an AssertionError is thrown with a message property set equal to the value
/** If the values are not strictly equal, an AssertionError is thrown with a message property set equal to the value
* of the message parameter. If the message parameter is undefined, a default error message is assigned.
* @example assert.throws(block[, error][, message])
*/
Expand All @@ -123,8 +111,7 @@ trait Assert extends js.Object {
def rejects(asyncFn: js.Promise[_]): Unit = js.native
}

/**
* Assert Singleton
/** Assert Singleton
*/
@js.native
@JSImport("assert", JSImport.Namespace)
Expand Down
21 changes: 7 additions & 14 deletions app/nodejs-v14/src/main/scala/io/scalajs/nodejs/Error.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import com.thoughtworks.enableIf
import scala.scalajs.js
import scala.scalajs.js.annotation.JSGlobal

/**
* Creates a new Error object and sets the error.message property to the provided text message.
/** Creates a new Error object and sets the error.message property to the provided text message.
* If an object is passed as message, the text message is generated by calling message.toString().
* The error.stack property will represent the point in the code at which new Error() was called.
* Stack traces are dependent on V8's stack trace API. Stack traces extend only to either (a) the
Expand All @@ -18,31 +17,27 @@ import scala.scalajs.js.annotation.JSGlobal
class Error() extends js.Object {
def this(message0: String) = this()

/**
* The `error.code` property is a string label that identifies the kind of error.
/** The `error.code` property is a string label that identifies the kind of error.
* `error.code` is the most stable way to identify an error.
* It will only change between major versions of Node.js.
* In contrast, error.message strings may change between any versions of Node.js
* See Node.js Error Codes for details about specific codes.
*/
val code: String = js.native

/**
* The error.message property is the string description of the error as set by calling new Error(message).
/** The error.message property is the string description of the error as set by calling new Error(message).
* The message passed to the constructor will also appear in the first line of the stack trace of the Error,
* however changing this property after the Error object is created may not change the first line of the
* stack trace (for example, when error.stack is read before this property is changed).
*/
val message: String = js.native

/**
* The error.stack property is a string describing the point in the code at which the Error was instantiated.
/** The error.stack property is a string describing the point in the code at which the Error was instantiated.
*/
val stack: js.Any = js.native
}

/**
* Error Singleton
/** Error Singleton
*/
@js.native
@JSGlobal
Expand All @@ -51,17 +46,15 @@ object Error extends js.Object {
// Properties
/////////////////////////////////////////////////////////////////////////////////

/**
* Error.stackTraceLimit
/** Error.stackTraceLimit
*/
def stackTraceLimit: Int = js.native

/////////////////////////////////////////////////////////////////////////////////
// Methods
/////////////////////////////////////////////////////////////////////////////////

/**
* Creates a .stack property on targetObject, which when accessed returns a string representing the location in the
/** Creates a .stack property on targetObject, which when accessed returns a string representing the location in the
* code at which Error.captureStackTrace() was called.
* @param targetObject The first line of the trace, instead of being prefixed with ErrorType: message, will be the
* result of calling targetObject.toString().
Expand Down
Loading

0 comments on commit 415e8c9

Please sign in to comment.