mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2025-05-07 07:12:15 +00:00
chore: Fix test with node 18/20 error message (#323)
* Fix test with node 18/20 error message * Run tests on node 18 and 20 * Enhance description * Fix type and obj property --------- Co-authored-by: Anatoly Laskaris <github_me@nahsi.dev>
This commit is contained in:
parent
c99a509c87
commit
2d2f5591cf
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@ -38,7 +38,7 @@ jobs:
|
||||
matrix:
|
||||
node-version:
|
||||
- 18.x
|
||||
# - 20.x
|
||||
- 20.x
|
||||
|
||||
steps:
|
||||
- name: Import secrets
|
||||
|
@ -129,6 +129,12 @@ describe('Tests for default handler', () => {
|
||||
// act
|
||||
const fn = builtInServices[req.serviceId][req.fnName];
|
||||
const res = await fn(req);
|
||||
|
||||
// Our test cases above depend on node error message. In node 20 error message for JSON.parse has changed.
|
||||
// Simple and fast solution for this specific case is to unify both variations into node 18 version error format.
|
||||
if (res.result === 'Unexpected token \'i\', "incorrect" is not valid JSON') {
|
||||
res.result = 'Unexpected token i in JSON at position 0';
|
||||
}
|
||||
|
||||
// assert
|
||||
expect(res).toMatchObject({
|
||||
|
Loading…
x
Reference in New Issue
Block a user