-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from splitio/refactor_reducer_and_actions
Refactor reducer and actions
- Loading branch information
Showing
11 changed files
with
197 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* eslint-disable @typescript-eslint/no-namespace */ | ||
/* eslint-disable @typescript-eslint/no-empty-interface */ | ||
|
||
// Custom matcher https://jest-archive-august-2023.netlify.app/docs/27.x/expect#expectextendmatchers | ||
import { expect } from '@jest/globals'; | ||
|
||
expect.extend({ | ||
toBeWithinRange(received: any, floor: number, ceiling: number) { | ||
const pass = received >= floor && received <= ceiling; | ||
if (pass) { | ||
return { | ||
message: () => | ||
`expected ${received} not to be within range ${floor} - ${ceiling}`, | ||
pass: true, | ||
}; | ||
} else { | ||
return { | ||
message: () => | ||
`expected ${received} to be within range ${floor} - ${ceiling}`, | ||
pass: false, | ||
}; | ||
} | ||
}, | ||
}); | ||
|
||
interface CustomMatchers<R = unknown> { | ||
toBeWithinRange(floor: number, ceiling: number): R; | ||
} | ||
|
||
declare global { | ||
namespace jest { | ||
interface Expect extends CustomMatchers { } | ||
interface Matchers<R> extends CustomMatchers<R> { } | ||
interface InverseAsymmetricMatchers extends CustomMatchers { } | ||
} | ||
} |
Oops, something went wrong.