Skip to content

Commit

Permalink
fix: createdAt test (#88)
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 createdAt on a new record (no id), whereas for new records a createdAt is generated in the constructor.
  • Loading branch information
iuliag authored Jan 19, 2024
1 parent b43b96d commit ac6a5ba
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Base Model Tests', () => {
describe('Getter Method Tests', () => {
it('correctly returns the createdAt date if provided', () => {
const createdAt = new Date().toISOString();
const baseEntity = Base({ createdAt });
const baseEntity = Base({ id: 'test-id', createdAt });
expect(baseEntity.getCreatedAt()).to.equal(createdAt);
});

Expand Down

0 comments on commit ac6a5ba

Please sign in to comment.