-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to pass array of chunk schedulers type (closes #33)
- Loading branch information
Showing
4 changed files
with
54 additions
and
6 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
__tests__/chunkSchedulers/getChunkScheduler.browser.test.ts
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,14 @@ | ||
import { getChunkScheduler } from '../../src/chunkSchedulers'; | ||
import { timeoutChunkScheduler } from '../../src/chunkSchedulers/timeout'; | ||
import { animationFrameChunkScheduler } from '../../src/chunkSchedulers/animationFrame'; | ||
import { idleCallbackChunkScheduler } from '../../src/chunkSchedulers/idleCallback'; | ||
|
||
describe('getChunkScheduler()', () => { | ||
it('should properly detect supported chunk scheduler', () => { | ||
expect(getChunkScheduler('animationFrame')).toBe(animationFrameChunkScheduler!); | ||
expect(getChunkScheduler('immediate')).toBe(timeoutChunkScheduler); | ||
expect(getChunkScheduler(['immediate', 'animationFrame'])).toBe(animationFrameChunkScheduler!); | ||
expect(getChunkScheduler(['immediate'])).toBe(timeoutChunkScheduler); | ||
expect(getChunkScheduler(['auto'])).toBe(idleCallbackChunkScheduler!); | ||
}); | ||
}); |
14 changes: 14 additions & 0 deletions
14
__tests__/chunkSchedulers/getChunkScheduler.nodejs.test.ts
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,14 @@ | ||
import { getChunkScheduler } from '../../src/chunkSchedulers'; | ||
import { timeoutChunkScheduler } from '../../src/chunkSchedulers/timeout'; | ||
import { immediateChunkScheduler } from '../../src/chunkSchedulers/immediate'; | ||
|
||
describe('getChunkScheduler()', () => { | ||
it('should properly detect supported chunk scheduler', () => { | ||
expect(getChunkScheduler('animationFrame')).toBe(timeoutChunkScheduler); | ||
expect(getChunkScheduler(['animationFrame', 'idleCallback'])).toBe(timeoutChunkScheduler); | ||
expect(getChunkScheduler('immediate')).toBe(immediateChunkScheduler!); | ||
expect(getChunkScheduler(['animationFrame', 'immediate'])).toBe(immediateChunkScheduler!); | ||
expect(getChunkScheduler(['animationFrame'])).toBe(timeoutChunkScheduler); | ||
expect(getChunkScheduler(['auto'])).toBe(immediateChunkScheduler!); | ||
}); | ||
}); |
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