You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* istanbul ignore next - due to skipped tests, see https://github.com/octokit/auth-app.js/pull/580 */
124
+
/* v8 ignore start - due to skipped tests, see https://github.com/octokit/auth-app.js/pull/580 */
125
125
try{
126
126
returnawaitrequest(options);
127
127
}catch(error: any){
@@ -150,4 +150,5 @@ async function sendRequestWithRetries(
test("supports custom cache with async get/set",async()=>{
1266
1266
constCACHE: {[key: string]: string}={};
1267
-
constget=jest
1267
+
constget=vi
1268
1268
.fn<(key: string)=>Promise<string>>()
1269
1269
.mockImplementation(async(key)=>CACHE[key]);
1270
-
constset=jest
1270
+
constset=vi
1271
1271
.fn<(key: string,value: string)=>Promise<void>>()
1272
1272
.mockImplementation(async(key,value)=>{
1273
1273
CACHE[key]=value;
@@ -1537,7 +1537,7 @@ test("auth.hook(): handle 401 due to an exp timestamp in the past", async () =>
1537
1537
};
1538
1538
});
1539
1539
1540
-
global.console.warn=jest.fn();
1540
+
global.console.warn=vi.fn();
1541
1541
1542
1542
constauth=createAppAuth({
1543
1543
appId: APP_ID,
@@ -1579,7 +1579,7 @@ test("auth.hook(): handle 401 due to an exp timestamp in the past with 800 secon
1579
1579
constfakeTimeMs=1029392939;
1580
1580
constgithubTimeMs=fakeTimeMs+800000;
1581
1581
1582
-
jest.setSystemTime(fakeTimeMs);
1582
+
vi.setSystemTime(fakeTimeMs);
1583
1583
1584
1584
constmock=fetchMock
1585
1585
.sandbox()
@@ -1614,7 +1614,7 @@ test("auth.hook(): handle 401 due to an exp timestamp in the past with 800 secon
1614
1614
};
1615
1615
});
1616
1616
1617
-
global.console.warn=jest.fn();
1617
+
global.console.warn=vi.fn();
1618
1618
1619
1619
constauth=createAppAuth({
1620
1620
appId: APP_ID,
@@ -1687,7 +1687,7 @@ test("auth.hook(): handle 401 due to an iat timestamp in the future", async () =
1687
1687
};
1688
1688
});
1689
1689
1690
-
global.console.warn=jest.fn();
1690
+
global.console.warn=vi.fn();
1691
1691
1692
1692
constauth=createAppAuth({
1693
1693
appId: APP_ID,
@@ -1744,7 +1744,7 @@ test("auth.hook(): throw 401 error in app auth flow without timing errors", asyn
1744
1744
},
1745
1745
});
1746
1746
1747
-
global.console.warn=jest.fn();
1747
+
global.console.warn=vi.fn();
1748
1748
1749
1749
constauth=createAppAuth({
1750
1750
appId: APP_ID,
@@ -1824,7 +1824,7 @@ test.skip("auth.hook(): handle 401 in first 5 seconds (#65)", async () => {
1824
1824
},
1825
1825
);
1826
1826
1827
-
global.console.warn=jest.fn();
1827
+
global.console.warn=vi.fn();
1828
1828
1829
1829
constauth=createAppAuth({
1830
1830
appId: APP_ID,
@@ -1851,10 +1851,10 @@ test.skip("auth.hook(): handle 401 in first 5 seconds (#65)", async () => {
1851
1851
1852
1852
// it takes 3 retries until a total time of more than 5s pass
1853
1853
// Note sure why the first advance is needed, but it helped unblock https://github.com/octokit/auth-app.js/pull/580
1854
-
awaitjest.advanceTimersByTimeAsync(100);
1855
-
awaitjest.advanceTimersByTimeAsync(1000);
1856
-
awaitjest.advanceTimersByTimeAsync(2000);
1857
-
awaitjest.advanceTimersByTimeAsync(3000);
1854
+
awaitvi.advanceTimersByTimeAsync(100);
1855
+
awaitvi.advanceTimersByTimeAsync(1000);
1856
+
awaitvi.advanceTimersByTimeAsync(2000);
1857
+
awaitvi.advanceTimersByTimeAsync(3000);
1858
1858
1859
1859
const{ data }=awaitpromise;
1860
1860
@@ -1875,7 +1875,7 @@ test.skip("auth.hook(): handle 401 in first 5 seconds (#65)", async () => {
1875
1875
// skipping flaky test, see https://github.com/octokit/auth-app.js/pull/580
1876
1876
test.skip("auth.hook(): throw error with custom message after unsuccessful retries (#163)",async()=>{
1877
1877
expect.assertions(1);
1878
-
global.console.warn=jest.fn();
1878
+
global.console.warn=vi.fn();
1879
1879
1880
1880
constmock=fetchMock
1881
1881
.sandbox()
@@ -1927,11 +1927,11 @@ test.skip("auth.hook(): throw error with custom message after unsuccessful retri
1927
1927
1928
1928
// it takes 3 retries until a total time of more than 5s pass
1929
1929
// Note sure why the first advance is needed, but it helped unblock https://github.com/octokit/auth-app.js/pull/580
1930
-
awaitjest.advanceTimersByTimeAsync(100);
1931
-
awaitjest.advanceTimersByTimeAsync(1000);
1932
-
awaitjest.advanceTimersByTimeAsync(2000);
1933
-
awaitjest.advanceTimersByTimeAsync(3000);
1934
-
awaitjest.runAllTimersAsync();
1930
+
awaitvi.advanceTimersByTimeAsync(100);
1931
+
awaitvi.advanceTimersByTimeAsync(1000);
1932
+
awaitvi.advanceTimersByTimeAsync(2000);
1933
+
awaitvi.advanceTimersByTimeAsync(3000);
1934
+
awaitvi.runAllTimersAsync();
1935
1935
1936
1936
awaitpromise;
1937
1937
});
@@ -1969,7 +1969,7 @@ test("auth.hook(): throws on 500 error without retries", async () => {
0 commit comments