Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kmruiz committed Nov 20, 2024
1 parent ca09d78 commit 8663269
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class MongoshBackendTest {
fun `generates a valid find query`() {
assertGeneratedJs(
"""
db.getSiblingDB("myDb").getCollection("myColl").find({ "field": 1})
db.getSiblingDB("myDb").getCollection("myColl").find({"field": 1})
""".trimIndent()
) {
emitDbAccess()
emitDatabaseAccess(registerConstant("myDb"))
emitCollectionAccess(registerConstant("myColl"))
emitFunctionName("find")
emitFunctionCall({
emitFunctionCall(long = false, {
emitObjectStart()
emitObjectKey(registerConstant("field"))
emitContextValue(registerConstant(1))
Expand All @@ -42,14 +42,14 @@ class MongoshBackendTest {
var myDb = ""
var myValue = ""
db.getSiblingDB(myDb).getCollection(myColl).find({ "field": myValue})
db.getSiblingDB(myDb).getCollection(myColl).find({"field": myValue})
""".trimIndent()
) {
emitDbAccess()
emitDatabaseAccess(registerVariable("myDb", BsonString))
emitCollectionAccess(registerVariable("myColl", BsonString))
emitFunctionName("find")
emitFunctionCall({
emitFunctionCall(long = false, {
emitObjectStart()
emitObjectKey(registerConstant("field"))
emitContextValue(registerVariable("myValue", BsonString))
Expand All @@ -66,14 +66,14 @@ class MongoshBackendTest {
var myDb = ""
var myValue = ""
db.getSiblingDB(myDb).getCollection(myColl).update({ "field": myValue}, { "myUpdate": 1})
db.getSiblingDB(myDb).getCollection(myColl).update({"field": myValue}, {"myUpdate": 1})
""".trimIndent()
) {
emitDbAccess()
emitDatabaseAccess(registerVariable("myDb", BsonString))
emitCollectionAccess(registerVariable("myColl", BsonString))
emitFunctionName("update")
emitFunctionCall({
emitFunctionCall(long = false, {
emitObjectStart()
emitObjectKey(registerConstant("field"))
emitContextValue(registerVariable("myValue", BsonString))
Expand Down

0 comments on commit 8663269

Please sign in to comment.