StateVoicesNational / Spoke

mass-contact text/SMS distribution tool
Other
460 stars 400 forks source link

node 20 updates / re #2351

Closed engelhartrueben closed 3 months ago

engelhartrueben commented 3 months ago

Fixes # (issue)

Removed

Upgraded Packages

Added Packages

Other

FAILING TESTS

  1. SQlite (running yarn test-sqlite) is storing a datetime object as a string. This has been an issue in previous versions of spoke as mentioned in a comment above.

    FAIL  __test__/backend.test.js
    ● graphql test suite › Campaign › Copy Campaign › creates and returns a copy of the campaign
    
    expect(received).toEqual(expected) // deep equality
    
    Expected: 2024-03-21T15:38:17.000Z
    Received: Date { NaN }
    
      634 |
      635 |             campaignDueBy.setMilliseconds(0);
    > 636 |             expect(copiedCampaign.due_by).toEqual(campaignDueBy);
          |                                           ^
      637 |           } else {
      638 |             expect(copiedCampaign.due_by).toEqual(campaign.due_by);
      639 |           }
    
      at Object.<anonymous> (__test__/backend.test.js:636:43)
    
    // Currently an open issue w/ datetime being stored as a string in SQLite3 
    // for Jest tests: https://github.com/TryGhost/node-sqlite3/issues/1355. 
    // This results in milliseconds being truncated when getting campaign due_by

// 3.15.2024 => Fails in SQLite testing now, but passes in PG. // copiedCampaign.due_by is an Invalid Date, and at some point // uses Date.parse()

2. NGP Van is having a type error. This error has persisted since the start of this branch.
```js
 FAIL  __test__/extensions/action-handlers/ngpvan-action.test.js
  ● ngpvn-action › #processAction › when something throws an exception › rethrows the exception

    expect(received).toEqual(expected) // deep equality

    Expected: StringMatching /^unexpected token*/i
    Received: "\"[object Object]\" is not valid JSON"

      1071 |         }
      1072 |
    > 1073 |         expect(error.message).toEqual(
           |                               ^
      1074 |           expect.stringMatching(/^unexpected token*/i)
      1075 |         );
      1076 |

      at _callee33$ (__test__/extensions/action-handlers/ngpvan-action.test.js:1073:31)
      at tryCatch (node_modules/@babel/runtime/helpers/regeneratorRuntime.js:44:17)
      at Generator.<anonymous> (node_modules/@babel/runtime/helpers/regeneratorRuntime.js:125:22)
      at Generator.throw (node_modules/@babel/runtime/helpers/regeneratorRuntime.js:69:21)
      at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
      at _throw (node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change, and any blockers that make your change a WIP

Checklist: