Skip to content

Commit

Permalink
test: fix updatedAt test
Browse files Browse the repository at this point in the history
In some cases, the test failed with assertion error, because it compared expected with passed updatedAt on a new record (no id), whereas for new records a updatedAt is generated in the constructor.

```
AssertionError: expected '2024-01-18T16:23:59.276Z' to equal '2024-01-18T16:23:59.275Z'
```
  • Loading branch information
iuliag committed Jan 30, 2024
1 parent 5222467 commit 7cdba3e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('Base Model Tests', () => {

it('correctly returns the updatedAt date if provided', () => {
const updatedAt = new Date().toISOString();
const baseEntity = Base({ updatedAt });
const baseEntity = Base({ id: 'test-id', updatedAt });
expect(baseEntity.getUpdatedAt()).to.equal(updatedAt);
});
});
Expand Down

0 comments on commit 7cdba3e

Please sign in to comment.