Skip to content

Commit

Permalink
issue #1332 fix unit tests failing on Windows to due to line end diff…
Browse files Browse the repository at this point in the history
…erences.
  • Loading branch information
wajda committed Jun 4, 2024
1 parent 4184e77 commit f69661c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package za.co.absa.spline.persistence.tx
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers
import org.scalatestplus.mockito.MockitoSugar
import za.co.absa.commons.scalatest.WhitespaceNormalizations.whiteSpaceNormalised
import za.co.absa.spline.persistence.model.NodeDef

class JSTxBuilderSpec extends AnyFlatSpec with Matchers with MockitoSugar {
Expand All @@ -31,7 +32,7 @@ class JSTxBuilderSpec extends AnyFlatSpec with Matchers with MockitoSugar {
.addQuery(NativeQuery("db.BAR();"))
.generateJs()

generatedJS shouldEqual {
(generatedJS shouldEqual {
"""
|function (_params) {
| const _db = require('internal').db;
Expand All @@ -43,7 +44,7 @@ class JSTxBuilderSpec extends AnyFlatSpec with Matchers with MockitoSugar {
| })(_db, _params[1]);
|}
|""".stripMargin
}
})(after being whiteSpaceNormalised)
}

it should "generate INSERT statements" in {
Expand All @@ -52,7 +53,7 @@ class JSTxBuilderSpec extends AnyFlatSpec with Matchers with MockitoSugar {
.addQuery(InsertQuery(NodeDef.Operation).copy(ignoreExisting = true))
.generateJs()

generatedJS shouldEqual {
(generatedJS shouldEqual {
"""
|function (_params) {
| const _db = require('internal').db;
Expand All @@ -70,7 +71,7 @@ class JSTxBuilderSpec extends AnyFlatSpec with Matchers with MockitoSugar {
| _db._collection("operation").insert(o, {silent:true}));
|}
|""".stripMargin
}
})(after being whiteSpaceNormalised)
}

it should "generate UPDATE statements" in {
Expand All @@ -79,7 +80,7 @@ class JSTxBuilderSpec extends AnyFlatSpec with Matchers with MockitoSugar {
.addQuery(UpdateQuery(NodeDef.DataSource, s"${UpdateQuery.DocWildcard}.baz == 777", Map.empty))
.generateJs()

generatedJS shouldEqual {
(generatedJS shouldEqual {
"""
|function (_params) {
| const _db = require('internal').db;
Expand All @@ -97,6 +98,6 @@ class JSTxBuilderSpec extends AnyFlatSpec with Matchers with MockitoSugar {
| `, {"b": _params[1]});
|}
|""".stripMargin
}
})(after being whiteSpaceNormalised)
}
}
2 changes: 1 addition & 1 deletion rest-gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"license": "Apache-2.0",
"scripts": {
"gen-api-doc:all": "npm run gen-api-doc --doc_name=consumer && npm run gen-api-doc --doc_name=producer",
"gen-api-doc": "node ./node_modules/@redocly/cli/bin/cli.js build-docs -o $npm_config_docs_dir/$npm_config_doc_name.html $npm_config_docs_dir/$npm_config_doc_name.swagger.json",
"gen-api-doc": "cross-env-shell node ./node_modules/@redocly/cli/bin/cli.js build-docs -o $npm_config_docs_dir/$npm_config_doc_name.html $npm_config_docs_dir/$npm_config_doc_name.swagger.json",
"build": "echo unused stage",
"test": "echo unused stage",
"lint": "echo unused stage"
Expand Down

0 comments on commit f69661c

Please sign in to comment.