-
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.
* chore: `parcel` 업데이트 * chore: `core-js` 업데이트 * Revert "chore: `core-js` 업데이트" This reverts commit 6c26696. * chore: `jest` 버전 업데이트 및 일부 `vitest` 적용 * chore: `babel-jest` 제거 * ci: 커버리지 설정 업데이트 * chore: export 전용 파일 ignore 처리 * chore: `babel` 의존성 위치 이동 및 업데이트 * chore: 미사용 의존성 제거 * chore: `webpack` 및 `eslint` 업데이트 * chore: `babel` 및 `webpack` 빌드 설정 업데이트 * chore: `eslint-plugin-compat` 제거 Babel transpile 및 polyfill 사용 설정하여 불필요
- Loading branch information
Showing
28 changed files
with
2,838 additions
and
2,239 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
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 was deleted.
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
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/* v8 ignore start */ | ||
export { default as Dispatcher } from './dispatcher.js'; | ||
export { default as Store } from './store.js'; | ||
export { ReduceStore, createStore } from './reduce.js'; | ||
export { ReduceStore, createStore } from './reduce.js'; | ||
/* v8 ignore stop */ |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
/* v8 ignore start */ | ||
export * from './common.js'; | ||
export * from './selector.js'; | ||
export * from './pattern-match.js'; | ||
export * from './fp.js'; | ||
export * from './optimize.js'; | ||
export * from './optimize.js'; | ||
/* v8 ignore stop */ |
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 |
---|---|---|
@@ -1,44 +1,45 @@ | ||
/** | ||
* @jest-environment jsdom | ||
* @vitest-environment happy-dom | ||
*/ | ||
import { vi, test, expect } from 'vitest'; | ||
import { debounce, throttle } from './optimize.js'; | ||
|
||
|
||
const fps = 60; | ||
const interval = Math.floor(1000 / fps); | ||
|
||
jest.useFakeTimers(); | ||
vi.useFakeTimers(); | ||
|
||
jest | ||
vi | ||
.spyOn(window, 'requestAnimationFrame') | ||
.mockImplementation(callback => setTimeout(callback, interval)); | ||
|
||
test('debounce', () => { | ||
const arr = [1, 2, 3]; | ||
const mock = jest.fn(); | ||
const mock = vi.fn(); | ||
const debounced = debounce(200)(mock); | ||
|
||
|
||
arr.forEach(debounced); | ||
expect(mock).not.toBeCalled(); | ||
|
||
jest.runAllTimers(); | ||
vi.runAllTimers(); | ||
|
||
expect(mock).toBeCalledTimes(1); | ||
}); | ||
|
||
test('throttle', () => { | ||
const mock = jest.fn(); | ||
const mock = vi.fn(); | ||
const throttled = throttle(mock); | ||
|
||
jest.advanceTimersByTime(8); | ||
vi.advanceTimersByTime(8); | ||
expect(mock).not.toBeCalled(); | ||
|
||
throttled(); | ||
expect(mock).not.toBeCalled(); | ||
|
||
throttled(); | ||
jest.advanceTimersByTime(16); | ||
vi.advanceTimersByTime(16); | ||
|
||
expect(mock).toBeCalledTimes(1); | ||
}); |
Oops, something went wrong.