Skip to content

Commit

Permalink
fix: throw out year dependent test (#455)
Browse files Browse the repository at this point in the history
* fix age test (throw out year dependent age calculation)

* clean up e2e spec file

* undo delete tested variable
  • Loading branch information
thommann authored Feb 27, 2023
1 parent 747b1f6 commit 60d448d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/test/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Test, TestingModule } from '@nestjs/testing';
import { INestApplication } from '@nestjs/common';
import * as request from 'supertest';
import request from 'supertest';
import { AppModule } from '../src/app.module';

describe('AppController (e2e)', () => {
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/helpers/format/date-helpers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Date Helpers', () => {
let birthday: Date
let date_one_year_one_day_ago: Date
let date_not_full_one_year: Date
beforeEach( () => {
beforeEach(() => {
birthday = new Date('2014-01-31T00:00:00.000Z')
date_one_year_one_day_ago = new Date(new Date().setFullYear(new Date().getFullYear() - 1))
date_one_year_one_day_ago.setDate(date_one_year_one_day_ago.getDate() - 1)
Expand All @@ -13,7 +13,6 @@ describe('Date Helpers', () => {
})
describe('calculated age', () => {
it('should return the age given his/her birthday', () => {
expect(calculateAge(birthday)).toEqual(8)
expect(calculateAge(date_one_year_one_day_ago)).toEqual(1)
expect(calculateAge(date_not_full_one_year)).toEqual(0)
});
Expand Down

0 comments on commit 60d448d

Please sign in to comment.