opral / inlang-message-sdk

0 stars 0 forks source link

inlang/rpc:test is failing because of google translate issue: #18

Closed jldec closed 2 months ago

jldec commented 2 months ago

Context

 ❯ src/functions/machineTranslateMessage.test.ts  (5 tests | 1 failed | 1 skipped) 805ms
   ❯ src/functions/machineTranslateMessage.test.ts > should not return escaped quotation marks
     → expected { id: 'mockMessage', alias: {}, …(2) } to deeply equal { id: 'mockMessage', alias: {}, …(2) }

⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯

 FAIL  src/functions/machineTranslateMessage.test.ts > should not return escaped quotation marks
AssertionError: expected { id: 'mockMessage', alias: {}, …(2) } to deeply equal { id: 'mockMessage', alias: {}, …(2) }

- Expected
+ Received

  Object {
    "alias": Object {},
    "id": "mockMessage",
    "selectors": Array [],
    "variants": Array [
      Object {
        "languageTag": "en",
        "match": Array [],
        "pattern": Array [
          Object {
            "type": "Text",
            "value": "'",
          },
          Object {
            "name": "id",
            "type": "VariableReference",
          },
          Object {
            "type": "Text",
            "value": "' added a new todo",
          },
        ],
      },
      Object {
        "languageTag": "de",
        "match": Array [],
        "pattern": Array [
          Object {
            "type": "Text",
            "value": "' ",
          },
          Object {
            "name": "id",
            "type": "VariableReference",
          },
          Object {
            "type": "Text",
-           "value": " ' hat eine neue Aufgabe hinzugefügt",
+           "value": " ' hat ein neues To-Do hinzugefügt",
          },
        ],
      },
    ],
  }

Proposal

fix it.