Skip to content

Commit

Permalink
test: fix erratic bug in functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sebtiz13 committed Oct 31, 2023
1 parent 73181d0 commit fa82658
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { Config } from "@jest/types";

// Sync object
const config: Config.InitialOptions = {
testTimeout: 20000,
transform: {
"^.+\\.tsx?$": ["ts-jest", { tsconfig: "./tests/tsconfig.json" }],
},
Expand Down
18 changes: 10 additions & 8 deletions tests/scenario/modules/devices/action-export-measures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,22 @@ describe("DevicesController:exportMeasures", () => {
{ deviceEUI: "linked1", temperature: 38 },
{
deviceEUI: "linked1",
temperature: 37,
temperature: {
value: 37,
/**
* Here we specify a measuredAt, because of a side effect in the decoder.
* Sometimes the acceleration measurement would be registered earlier than the temperature's one.
*
* The +10sec is to ensure that those two measures will always remain the last ones.
*/
measuredAt: Date.now() + 10000,
},
acceleration: {
x: 1,
y: 2.5,
z: -1,
accuracy: 0.1,
},
/**
* Here we specify a measuredAt, because of a side effect in the decoder.
* Sometimes the acceleration measurement would be registered earlier than the temperature's one.
*
* The +10sec is to ensure that those two measures will always remain the last ones.
*/
measuredAt: Date.now() + 10000,
},
]);
await sdk.collection.refresh("engine-ayse", "measures");
Expand Down

0 comments on commit fa82658

Please sign in to comment.