Skip to content

Commit

Permalink
fix homewood
Browse files Browse the repository at this point in the history
  • Loading branch information
juliaqiuxy committed Jan 14, 2023
1 parent e942792 commit bc20d48
Show file tree
Hide file tree
Showing 6 changed files with 900 additions and 674 deletions.
11 changes: 11 additions & 0 deletions src/workers/parseWorker/__tests__/weatherUtil-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
weatherStatusOrNull,
notEmptyStringOrNull,
removeNumberInFrontOfName,
parseNumberFromString,
} from '../weatherUtil';

test('tests if valid number', () => {
Expand Down Expand Up @@ -186,3 +187,13 @@ test('removes the first index and returns a string or null', () => {
expect(removeNumberInFrontOfName('')).toBe(null);
expect(removeNumberInFrontOfName(-100)).toBe(null);
});


test('extracts number from string', () => {
expect(parseNumberFromString()).toBeNaN();
expect(parseNumberFromString('1 rain')).toBe(1);
expect(parseNumberFromString('567 clear-day')).toBe(567);
expect(parseNumberFromString('')).toBeNaN();
expect(parseNumberFromString({})).toBeNaN();
});

Large diffs are not rendered by default.

Loading

0 comments on commit bc20d48

Please sign in to comment.