Skip to content

feat: Upgrade TS to 4.0.3 in datafile-manager #669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ jobs:
- <<: *packagetest
before_install: cd packages/logging
- <<: *packagetest
before_script: npm install "@react-native-async-storage/async-storage"
before_install: cd packages/datafile-manager

- stage: 'Source Clear'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ describe('httpPollingDatafileManager', () => {
headers: {},
});
await responsePromise;
await advanceTimersByTime(0);
expect(makeGetRequestSpy).toBeCalledTimes(2);
});
});
Expand Down Expand Up @@ -334,7 +335,7 @@ describe('httpPollingDatafileManager', () => {
await manager.onReady();
expect(JSON.parse(manager.get())).toEqual({ foo: 'bar' });

advanceTimersByTime(1000);
await advanceTimersByTime(1000);

expect(manager.responsePromises.length).toBe(2);
manager.stop();
Expand Down Expand Up @@ -409,7 +410,7 @@ describe('httpPollingDatafileManager', () => {
// First response promise was for the initial 200 response
expect(manager.responsePromises.length).toBe(1);
// Trigger the queued update
advanceTimersByTime(1000);
await advanceTimersByTime(1000);
// Second response promise is for the 304 response
expect(manager.responsePromises.length).toBe(2);
await manager.responsePromises[1];
Expand All @@ -436,7 +437,7 @@ describe('httpPollingDatafileManager', () => {
manager.start();
await manager.onReady();
const makeGetRequestSpy = jest.spyOn(manager, 'makeGetRequest');
advanceTimersByTime(1000);
await advanceTimersByTime(1000);
expect(makeGetRequestSpy).toBeCalledTimes(1);
const firstCall = makeGetRequestSpy.mock.calls[0];
const headers = firstCall[1];
Expand Down Expand Up @@ -468,7 +469,7 @@ describe('httpPollingDatafileManager', () => {
expect(makeGetRequestSpy).toBeCalledTimes(1);

// But after another 5 seconds, another request should be made
advanceTimersByTime(5000);
await advanceTimersByTime(5000);
expect(makeGetRequestSpy).toBeCalledTimes(2);
});

Expand Down
Loading