8000 fixes · optimizely/javascript-sdk@cd0c26b · GitHub
[go: up one dir, main page]

Skip to content

Commit cd0c26b

Browse files
committed
fixes
1 parent 639ec9c commit cd0c26b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/optimizely-sdk/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"@types/jest": "^23.3.14",
5656
"@types/mocha": "^5.2.7",
5757
"@types/nise": "^1.4.0",
58-
"@types/node": "^11.11.7",
58+
"@types/node": "^18.7.18",
5959
"@types/uuid": "^3.4.4",
6060
"@typescript-eslint/eslint-plugin": "^5.33.0",
6161
"@typescript-eslint/parser": "^5.33.0",
@@ -78,8 +78,8 @@
7878
"lodash": "^4.17.11",
7979
"mocha": "^5.2.0",
8080
"mocha-lcov-reporter": "^1.3.0",
81-
"nise": "^1.4.10",
82-
"nock": "11.9.1",
81+
"nise": "^5.1.1",
82+
"nock": "^13.2.9",
8383
"nyc": "^15.0.1",
8484
"prettier": "^1.19.1",
8585
"promise-polyfill": "8.1.0",

packages/optimizely-sdk/tests/nodeRequestHandler.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ describe('NodeRequestHandler', () => {
202202
jest.clearAllTimers();
203203
});
204204

205-
it('should reject the response promise and abort the request when the response is not received before the timeout', async () => {
205+
it.only('should reject the response promise and abort the request when the response is not received before the timeout', async () => {
206206
const scope = nock(host)
207207
.get(path)
208208
.delay({ head: 2000, body: 2000 })
@@ -220,6 +220,9 @@ describe('NodeRequestHandler', () => {
220220

221221
const request = new NodeRequestHandler(new NoOpLogger(), 100).makeRequest(`${host}${path}`, {}, 'get');
222222

223+
jest.advanceTimersByTime(60000);
224+
jest.runAllTimers(); // <- explicitly tell jest to run all setTimeout, setInterval
225+
jest.runAllTicks(); // <- explicitly tell jest to run all Promise callback
223226
await expect(request.responsePromise).rejects.toThrow();
224227
expect(abortEventListener).toBeCalledTimes(1);
225228

0 commit comments

Comments
 (0)
0