Skip to content

Commit

Permalink
Fix typos and immutability tests
Browse files Browse the repository at this point in the history
  • Loading branch information
FriendlyUser1 committed Jul 15, 2024
1 parent 5de2c23 commit c04e10a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 26 deletions.
2 changes: 1 addition & 1 deletion exercises/practice/lens-person/lens-person.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// This is only a SKELETON file for the 'Lense Person' exercise. It's been provided as a
// This is only a SKELETON file for the 'Lens Person' exercise. It's been provided as a
// convenience to get you started writing code faster.
//

Expand Down
30 changes: 5 additions & 25 deletions exercises/practice/lens-person/lens-person.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { bornAtLens, nameLens, streetLens } from './lens-person';

// test data
const person = new Person(
new Name('Saravanan', 'Lakshamanan'),
new Name('Saravanan', 'Lakshmanan'),
new Born(
new Address(100, 'Hospital street', 'Tamil Nadu', 'India'),
new Date(),
Expand All @@ -32,9 +32,7 @@ describe('nameLens', () => {
});

xtest('should ensure immutability by checking the original person object', () => {
expect(person).not.toStrictEqual(
new Person(new Name('Sara', 'Lakshamanan'), person.born, person.address),
);
expect(person.name).toStrictEqual(new Name('Saravanan', 'Lakshmanan'));
});
});

Expand All @@ -53,15 +51,8 @@ describe('bornAtLens', () => {
});

xtest('should ensure immutability by checking the original person object', () => {
expect(person).not.toEqual(
new Person(
person.name,
new Born(
new Address(2, 'Exercism street', 'Tamil Nadu', 'India'),
person.born.bornOn,
),
person.address,
),
expect(person.born.bornAt).toStrictEqual(
new Address(100, 'Hospital street', 'Tamil Nadu', 'India'),
);
});
});
Expand All @@ -78,17 +69,6 @@ describe('streetLens', () => {
});

xtest('should ensure immutability by checking the original person object', () => {
expect(person).not.toEqual(
new Person(
person.name,
person.born,
new Address(
person.address.houseNumber,
'Exercism Street',
person.address.place,
person.address.country,
),
),
);
expect(person.address.street).toStrictEqual('Coder street');
});
});

0 comments on commit c04e10a

Please sign in to comment.