Skip to content

Commit 6cca43f

Browse files
committed
palindrome-products: convert generate to static method
1 parent 00a2f0e commit 6cca43f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

exercises/palindrome-products/palindrome-products.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { generatePalindrome } from './palindrome-products';
1+
import { Palindrome } from './palindrome-products';
22

33
describe('Palindrome', () => {
44
test('largest palindrome from single digit factors', () => {
5-
const palindromes = generatePalindrome({ maxFactor: 9 });
5+
const palindromes = Palindrome.generate({ maxFactor: 9 });
66
const largest = palindromes.largest;
77

88
expect(largest.value).toEqual(9);
@@ -11,31 +11,31 @@ describe('Palindrome', () => {
1111
});
1212

1313
xtest('largest palindrome from double digit factors', () => {
14-
const palindromes = generatePalindrome({ maxFactor: 99, minFactor: 10 });
14+
const palindromes = Palindrome.generate({ maxFactor: 99, minFactor: 10 });
1515
const largest = palindromes.largest;
1616

1717
expect(largest.value).toEqual(9009);
1818
expect(largest.factors).toEqual([91, 99]);
1919
});
2020

2121
xtest('smallest palindrome from double digit factors', () => {
22-
const palindromes = generatePalindrome({ maxFactor: 99, minFactor: 10 });
22+
const palindromes = Palindrome.generate({ maxFactor: 99, minFactor: 10 });
2323
const smallest = palindromes.smallest;
2424

2525
expect(smallest.value).toEqual(121);
2626
expect(smallest.factors).toEqual([11, 11]);
2727
});
2828

2929
xtest('largest palindrome from triple digit factors', () => {
30-
const palindromes = generatePalindrome({ maxFactor: 999, minFactor: 100 });
30+
const palindromes = Palindrome.generate({ maxFactor: 999, minFactor: 100 });
3131
const largest = palindromes.largest;
3232

3333
expect(largest.value).toEqual(906609);
3434
expect(largest.factors).toEqual([913, 993]);
3535
});
3636

3737
xtest('smallest palindrome from triple digit factors', () => {
38-
const palindromes = generatePalindrome({ maxFactor: 999, minFactor: 100 });
38+
const palindromes = Palindrome.generate({ maxFactor: 999, minFactor: 100 });
3939
const smallest = palindromes.smallest;
4040

4141
expect(smallest.value).toEqual(10201);

0 commit comments

Comments
 (0)