Skip to content

Commit 12fe19a

Browse files
Apply suggestions from code review
1 parent 23355e6 commit 12fe19a

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

concepts/type-checking/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ It can also survive false positives where an object isn't actually an `Array`, a
8585
8686
Array.isArray({ __proto__: Array.prototype })
8787
// => false
88-
````
88+
```
8989
9090
````
9191

exercises/concept/recycling-robot/.docs/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ It can also survive false positives where an object isn't actually an `Array`, a
8585
8686
Array.isArray({ __proto__: Array.prototype })
8787
// => false
88-
````
88+
```
8989
9090
````
9191

exercises/concept/recycling-robot/assembly-line.spec.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
hasDefinedType,
1414
} from './assembly-line';
1515
import { ElectronicDevice } from './lib.js';
16+
1617
describe('isBoolean', () => {
1718
test('isBoolean works on booleans', () => {
1819
expect(isBoolean(true)).toBe(true);
@@ -26,6 +27,7 @@ describe('isBoolean', () => {
2627
expect(isBoolean(Symbol('1'))).toBe(false);
2728
});
2829
});
30+
2931
describe('isNumber', () => {
3032
test('isNumber works on numbers', () => {
3133
expect(isNumber(42)).toBe(true);
@@ -49,13 +51,15 @@ describe('isNumber', () => {
4951
expect(isNumber(Infinity)).toBe(false);
5052
});
5153
});
54+
5255
class ClassForTesting {
5356
constructor(number, word) {
5457
this.number = number;
5558
this.word = word;
5659
}
5760
id() {}
5861
}
62+
5963
describe('isObject', () => {
6064
test('isObject works on objects', () => {
6165
expect(isObject({})).toBe(true);
@@ -77,6 +81,7 @@ describe('isObject', () => {
7781
expect(isObject(null)).toBe(false);
7882
});
7983
});
84+
8085
describe('isNumericString', () => {
8186
test('isNumericString works on numeric strings', () => {
8287
expect(isNumericString('42')).toBe(true);
@@ -95,10 +100,12 @@ describe('isNumericString', () => {
95100
expect(isNumericString(Symbol('\u0070'))).toBe(false);
96101
});
97102
});
103+
98104
class Oven extends ElectronicDevice {}
99105
class Computer extends ElectronicDevice {}
100106
class PersonalComputer extends Computer {}
101107
class HomeMadePersonalComputer extends PersonalComputer {}
108+
102109
describe('isElectronic', () => {
103110
test('isElectronic works on instances of ElectronicDevice or its child classes', () => {
104111
expect(isElectronic(new ElectronicDevice())).toBe(true);
@@ -124,6 +131,7 @@ describe('isElectronic', () => {
124131
expect(isElectronic(new HomeMadePersonalComputer())).toBe(true);
125132
});
126133
});
134+
127135
describe('isNonEmptyArray', () => {
128136
test('isNonEmptyArray works on non-empty arrays', () => {
129137
expect(isNonEmptyArray([1, 2, 3])).toBe(true);
@@ -152,9 +160,11 @@ describe('isEmptyArray', () => {
152160
expect(isEmptyArray(123)).toBe(false);
153161
});
154162
});
163+
155164
class TestAssertHasId {
156165
id() {}
157166
}
167+
158168
describe('assertHasId', () => {
159169
test("assertHasId throws error if object has no 'id' property or method", () => {
160170
expect(() => assertHasId({})).toThrow();
@@ -164,9 +174,11 @@ describe('assertHasId', () => {
164174
expect(() => assertHasId(new TestAssertHasId())).not.toThrow();
165175
});
166176
});
177+
167178
class TestHasType {
168179
type() {}
169180
}
181+
170182
describe('hasType', () => {
171183
test('hasType works correctly', () => {
172184
expect(hasType({ type: 'example' })).toBe(true);

0 commit comments

Comments
 (0)