From 056f7d48812a4439bfd2ae638993638dd8c2c657 Mon Sep 17 00:00:00 2001 From: AutoQA Engine Date: Thu, 5 Mar 2026 05:52:39 +0000 Subject: [PATCH] =?UTF-8?q?chore(qa):=20=F0=9F=A4=96=20AutoQA=20Engine=20G?= =?UTF-8?q?enerated=20Tests=20&=20Patches?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __mocks__/fileMock.js | 1 + __mocks__/styleMock.js | 1 + final_results.json | 106 ++++++++++ jest.config.cjs | 15 ++ lib/index.auto.test.js | 214 +++++++++++++++++++++ package.json | 3 +- qa_reports/cors_test_report_2026-03-05.pdf | Bin 0 -> 29778 bytes run_1_results.json | 120 ++++++++++++ run_2_results.json | 120 ++++++++++++ run_3_results.json | 112 +++++++++++ run_4_results.json | 29 +++ run_5_results.json | 106 ++++++++++ 12 files changed, 826 insertions(+), 1 deletion(-) create mode 100644 __mocks__/fileMock.js create mode 100644 __mocks__/styleMock.js create mode 100644 final_results.json create mode 100644 jest.config.cjs create mode 100644 lib/index.auto.test.js create mode 100644 qa_reports/cors_test_report_2026-03-05.pdf create mode 100644 run_1_results.json create mode 100644 run_2_results.json create mode 100644 run_3_results.json create mode 100644 run_4_results.json create mode 100644 run_5_results.json diff --git a/__mocks__/fileMock.js b/__mocks__/fileMock.js new file mode 100644 index 0000000..0a445d0 --- /dev/null +++ b/__mocks__/fileMock.js @@ -0,0 +1 @@ +module.exports = "test-file-stub"; diff --git a/__mocks__/styleMock.js b/__mocks__/styleMock.js new file mode 100644 index 0000000..f053ebf --- /dev/null +++ b/__mocks__/styleMock.js @@ -0,0 +1 @@ +module.exports = {}; diff --git a/final_results.json b/final_results.json new file mode 100644 index 0000000..078914b --- /dev/null +++ b/final_results.json @@ -0,0 +1,106 @@ +{ + "success": true, + "totalSuites": 1, + "passedSuites": 1, + "failedSuites": 0, + "totalTests": 13, + "passed": 13, + "failed": 0, + "skipped": 0, + "pending": 0, + "duration": 535, + "runtimeErrors": [], + "testFileResults": [ + { + "file": "/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js", + "status": "passed", + "duration": 422, + "tests": [ + { + "name": "middlewareWrapper should exist", + "status": "passed", + "duration": 3, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should return a function", + "status": "passed", + "duration": 1, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should call next with no options (GET request)", + "status": "passed", + "duration": 3, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Origin with default options (GET request)", + "status": "passed", + "duration": 1, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Origin with custom options (GET request)", + "status": "passed", + "duration": 7, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should NOT set Access-Control-Allow-Methods for a non-OPTIONS request with default options (GET request)", + "status": "passed", + "duration": 1, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should NOT set Access-Control-Allow-Methods for a non-OPTIONS request with custom options (GET request)", + "status": "passed", + "duration": 1, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should NOT set Access-Control-Allow-Credentials with default options (GET request)", + "status": "passed", + "duration": 1, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Credentials with custom options (GET request)", + "status": "passed", + "duration": 2, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should handle preflight request with default options", + "status": "passed", + "duration": 2, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should handle preflight request with custom options", + "status": "passed", + "duration": 2, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should handle error from options callback", + "status": "passed", + "duration": 1, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should handle error from origin callback", + "status": "passed", + "duration": 1, + "failureMessages": [] + } + ], + "errors": [] + } + ], + "coverageSummary": { + "available": true, + "note": "Coverage map present in results" + }, + "rawStderr": "" +} \ No newline at end of file diff --git a/jest.config.cjs b/jest.config.cjs new file mode 100644 index 0000000..c8021aa --- /dev/null +++ b/jest.config.cjs @@ -0,0 +1,15 @@ +module.exports = { + testEnvironment: "node", + roots: [""], + testMatch: [ + "**/*.auto.test.js", + "**/*.auto.test.ts", + ], + moduleNameMapper: { + "^@/(.*)$": "/$1", + }, + collectCoverage: true, + coverageReporters: ["json-summary", "text"], + coverageDirectory: "/coverage", + maxWorkers: "50%", +}; \ No newline at end of file diff --git a/lib/index.auto.test.js b/lib/index.auto.test.js new file mode 100644 index 0000000..2e5980d --- /dev/null +++ b/lib/index.auto.test.js @@ -0,0 +1,214 @@ +const middlewareWrapper = require('./index'); + +const mockReq = (options) => ({ + method: options.method, + headers: options.headers || {}, +}); + +// Modified mockRes to accept an optional doneCallback and call it when res.end() is invoked. +// This is crucial for preflight (OPTIONS) requests where preflightContinue is false, +// as the middleware calls res.end() instead of next(). +const mockRes = (doneCallback) => { + const res = { + setHeader: jest.fn(), + getHeader: jest.fn().mockReturnValue(''), // Used by 'vary' module + end: jest.fn(), + statusCode: 200, + writeHead: jest.fn(), // Not used by the middleware + }; + + // If a doneCallback is provided, call it when res.end() is invoked. + res.end.mockImplementation(() => { + if (doneCallback) { + doneCallback(); + } + }); + return res; +}; + +describe('middlewareWrapper', () => { + test('should exist', () => { + expect(middlewareWrapper).toBeDefined(); + }); + + test('should return a function', () => { + const middleware = middlewareWrapper(); + expect(typeof middleware).toBe('function'); + }); + + test('should call next with no options (GET request)', (done) => { + const middleware = middlewareWrapper(); + const req = mockReq({ method: 'GET' }); + const res = mockRes(); // next() is expected to be called, so no doneCallback for res.end() + middleware(req, res, (err) => { + expect(err).toBeFalsy(); + // For a GET request with default options (origin: '*'), only Access-Control-Allow-Origin is set. + expect(res.setHeader).toHaveBeenCalledTimes(1); + expect(res.setHeader).toHaveBeenCalledWith('Access-Control-Allow-Origin', '*'); + done(); + }); + }); + + test('should set Access-Control-Allow-Origin with default options (GET request)', (done) => { + const middleware = middlewareWrapper(); + const req = mockReq({ method: 'GET', headers: { origin: 'http://example.com' } }); + const res = mockRes(); // next() is expected to be called, so no doneCallback for res.end() + middleware(req, res, (err) => { + expect(err).toBeFalsy(); + // For a GET request with default options (origin: '*'), only Access-Control-Allow-Origin is set. + expect(res.setHeader).toHaveBeenCalledTimes(1); + expect(res.setHeader).toHaveBeenCalledWith('Access-Control-Allow-Origin', '*'); + done(); + }); + }); + + test('should set Access-Control-Allow-Origin with custom options (GET request)', (done) => { + const options = { origin: 'http://example.com' }; + const middleware = middlewareWrapper(options); + const req = mockReq({ method: 'GET', headers: { origin: 'http://example.com' } }); + const res = mockRes(); // next() is expected to be called, so no doneCallback for res.end() + middleware(req, res, (err) => { + expect(err).toBeFalsy(); + // For a GET request with a specific origin, Access-Control-Allow-Origin and Vary: Origin are set. + expect(res.setHeader).toHaveBeenCalledTimes(2); + expect(res.setHeader).toHaveBeenCalledWith('Access-Control-Allow-Origin', 'http://example.com'); + expect(res.setHeader).toHaveBeenCalledWith('Vary', 'Origin'); + done(); + }); + }); + + test('should NOT set Access-Control-Allow-Methods for a non-OPTIONS request with default options (GET request)', (done) => { + const middleware = middlewareWrapper(); + const req = mockReq({ method: 'GET' }); + const res = mockRes(); // next() is expected to be called, so no doneCallback for res.end() + middleware(req, res, (err) => { + expect(err).toBeFalsy(); + // For a GET request, only Access-Control-Allow-Origin is set. + expect(res.setHeader).toHaveBeenCalledTimes(1); + expect(res.setHeader).not.toHaveBeenCalledWith('Access-Control-Allow-Methods', expect.any(String)); + done(); + }); + }); + + test('should NOT set Access-Control-Allow-Methods for a non-OPTIONS request with custom options (GET request)', (done) => { + const options = { methods: 'GET,POST' }; + const middleware = middlewareWrapper(options); + const req = mockReq({ method: 'GET' }); + const res = mockRes(); // next() is expected to be called, so no doneCallback for res.end() + middleware(req, res, (err) => { + expect(err).toBeFalsy(); + // For a GET request, only Access-Control-Allow-Origin is set. + expect(res.setHeader).toHaveBeenCalledTimes(1); + expect(res.setHeader).not.toHaveBeenCalledWith('Access-Control-Allow-Methods', expect.any(String)); + done(); + }); + }); + + test('should NOT set Access-Control-Allow-Credentials with default options (GET request)', (done) => { + const middleware = middlewareWrapper(); + const req = mockReq({ method: 'GET' }); + const res = mockRes(); // next() is expected to be called, so no doneCallback for res.end() + middleware(req, res, (err) => { + expect(err).toBeFalsy(); + // For a GET request with default options (credentials: false), only Access-Control-Allow-Origin is set. + expect(res.setHeader).toHaveBeenCalledTimes(1); + expect(res.setHeader).not.toHaveBeenCalledWith('Access-Control-Allow-Credentials', 'true'); + done(); + }); + }); + + test('should set Access-Control-Allow-Credentials with custom options (GET request)', (done) => { + const options = { credentials: true }; + const middleware = middlewareWrapper(options); + const req = mockReq({ method: 'GET' }); + const res = mockRes(); // next() is expected to be called, so no doneCallback for res.end() + middleware(req, res, (err) => { + expect(err).toBeFalsy(); + // For a GET request with credentials: true, Access-Control-Allow-Origin and Access-Control-Allow-Credentials are set. + expect(res.setHeader).toHaveBeenCalledTimes(2); + expect(res.setHeader).toHaveBeenCalledWith('Access-Control-Allow-Credentials', 'true'); + done(); + }); + }); + + test('should handle preflight request with default options', (done) => { + const middleware = middlewareWrapper(); + const req = mockReq({ method: 'OPTIONS', headers: { 'Access-Control-Request-Method': 'GET' } }); + const res = mockRes(done); // Pass done to mockRes, as res.end() will be called and next() will NOT be. + + // The next() callback is not expected to be called by the middleware for preflightContinue: false. + // Assertions are placed after the middleware call, and Jest will wait for done() to be called by res.end(). + middleware(req, res, () => { /* next() is not called, so no assertions here */ }); + + // Headers for OPTIONS with default options: + // 1. Access-Control-Allow-Origin: * + // 2. Access-Control-Allow-Methods: GET,HEAD,PUT,PATCH,POST,DELETE + // 3. Vary: Access-Control-Request-Headers (because allowedHeaders is not specified) + // 4. Content-Length: 0 (for 204 status) + expect(res.setHeader).toHaveBeenCalledTimes(4); + expect(res.setHeader).toHaveBeenCalledWith('Access-Control-Allow-Origin', '*'); + expect(res.setHeader).toHaveBeenCalledWith('Access-Control-Allow-Methods', 'GET,HEAD,PUT,PATCH,POST,DELETE'); + expect(res.setHeader).toHaveBeenCalledWith('Vary', 'Access-Control-Request-Headers'); + expect(res.setHeader).toHaveBeenCalledWith('Content-Length', '0'); + expect(res.statusCode).toBe(204); + expect(res.end).toHaveBeenCalledTimes(1); + }); + + test('should handle preflight request with custom options', (done) => { + const options = { methods: 'GET,POST', credentials: true }; + const middleware = middlewareWrapper(options); + const req = mockReq({ method: 'OPTIONS', headers: { 'Access-Control-Request-Method': 'GET' } }); + const res = mockRes(done); // Pass done to mockRes, as res.end() will be called and next() will NOT be. + + // The next() callback is not expected to be called by the middleware for preflightContinue: false. + // Assertions are placed after the middleware call, and Jest will wait for done() to be called by res.end(). + middleware(req, res, () => { /* next() is not called, so no assertions here */ }); + + // Headers for OPTIONS with custom options: + // 1. Access-Control-Allow-Origin: * (origin not specified in options, so defaults to '*') + // 2. Access-Control-Allow-Credentials: true + // 3. Access-Control-Allow-Methods: GET,POST + // 4. Vary: Access-Control-Request-Headers (because allowedHeaders is not specified) + // 5. Content-Length: 0 (for 204 status) + expect(res.setHeader).toHaveBeenCalledTimes(5); + expect(res.setHeader).toHaveBeenCalledWith('Access-Control-Allow-Origin', '*'); + expect(res.setHeader).toHaveBeenCalledWith('Access-Control-Allow-Credentials', 'true'); + expect(res.setHeader).toHaveBeenCalledWith('Access-Control-Allow-Methods', 'GET,POST'); + expect(res.setHeader).toHaveBeenCalledWith('Vary', 'Access-Control-Request-Headers'); + expect(res.setHeader).toHaveBeenCalledWith('Content-Length', '0'); + expect(res.statusCode).toBe(204); + expect(res.end).toHaveBeenCalledTimes(1); + }); + + test('should handle error from options callback', (done) => { + const error = new Error('Test error from options'); + const optionsDelegate = (req, cb) => { + cb(error); // Simulate an error from the options delegate + }; + const middleware = middlewareWrapper(optionsDelegate); + const req = mockReq({ method: 'GET' }); + const res = mockRes(); // next(err) is expected to be called, so no doneCallback for res.end() + middleware(req, res, (err) => { + expect(err).toBe(error); + expect(res.setHeader).not.toHaveBeenCalled(); // No headers should be set on error + done(); + }); + }); + + test('should handle error from origin callback', (done) => { + const error = new Error('Test error from origin'); + const options = { + origin: (origin, cb) => { + cb(error); // Simulate an error from the origin delegate + } + }; + const middleware = middlewareWrapper(options); + const req = mockReq({ method: 'GET', headers: { origin: 'http://example.com' } }); + const res = mockRes(); // next(err) is expected to be called, so no doneCallback for res.end() + middleware(req, res, (err) => { + expect(err).toBe(error); + expect(res.setHeader).not.toHaveBeenCalled(); // No headers should be set on error + done(); + }); + }); +}); \ No newline at end of file diff --git a/package.json b/package.json index e90bac8..44b60b5 100644 --- a/package.json +++ b/package.json @@ -24,9 +24,10 @@ "after": "0.8.2", "eslint": "7.30.0", "express": "4.21.2", + "jest": "^30.2.0", "mocha": "9.2.2", "nyc": "15.1.0", - "supertest": "6.1.3" + "supertest": "^6.1.3" }, "files": [ "lib/index.js" diff --git a/qa_reports/cors_test_report_2026-03-05.pdf b/qa_reports/cors_test_report_2026-03-05.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e127467339ff72ce0b8180c5222ce13fda1e9239 GIT binary patch literal 29778 zcmc$`1C%7&wl-R}Z6nLJx@_CFZFbr2vTYk(w!6!Ab=mHE)%%?N-!tyL+@4BZCp&9h#16d3|&k`OpWbLO#fWw?BZlfH%c5L#FdIOohv`QJB}-vSCfR&%}#xm0fAj>0- zq{qh-4`@{-X~@PSBY*ii!4Q&76h2WBpRD{YmO-b_A^=&tJr!p3ta!hzBBBL*Z?{zp zeE>?S>f~JwutF`1RIYsv zIC_1$mj7^*N*LIZ6WH|eG|d{MSVkyXHv;N8oA?S+FNGk*hC#cBXJ)0Jm8bI#TNg8Q z={^i(jh2$k2oRbi+lx-&pDQRTl0+8hL$4`ti!B1c@`6e2fG(f3kAv6rBlaO0)*By> z03Rfg=&U&*!h$CQ_RWuOq1)khPl6MT@-ynWLBUrW@tR9WJe>ep@?XF2>f#EPeAVfv zjwXr@gzERq1X)Q3Es{9Ci2?RVX64lAI%N+jm9$~e2@!;u(3&az=y67K-zvi&>TZxR z_~ir%yj?@@zcrFiAr#rs$UR1jdufAjt`76uqvT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gTcWEf-*s0U+xC=3H07zEj>FP8xZ$|x%gl)?VNF;GT)F)##!oH205zG2`) at processTicksAndRejections (node:internal/process/task_queues:105:5) at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Origin with default options", + "status": "passed", + "duration": 2, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Origin with custom options", + "status": "failed", + "duration": 2, + "failureMessages": [ + "Error: expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\nExpected number of calls: 1\nReceived number of calls: 2\n at toHaveBeenCalledTimes (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:57:29)\n at next (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:188:7)\n at cors (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:224:17)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:214:15)\n at originCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:219:13)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:199:9)\n at optionsCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:204:7)\n at Object.middleware (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:55:5) at new Promise () at processTicksAndRejections (node:internal/process/task_queues:105:5) at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Methods with default options", + "status": "failed", + "duration": 5, + "failureMessages": [ + "Error: expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\nExpected number of calls: 2\nReceived number of calls: 1\n at toHaveBeenCalledTimes (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:69:29)\n at next (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:188:7)\n at cors (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:224:17)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:214:15)\n at originCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:219:13)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:199:9)\n at optionsCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:204:7)\n at Object.middleware (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:67:5) at new Promise () at processTicksAndRejections (node:internal/process/task_queues:105:5) at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Methods with custom options", + "status": "failed", + "duration": 1, + "failureMessages": [ + "Error: expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\nExpected number of calls: 2\nReceived number of calls: 1\n at toHaveBeenCalledTimes (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:82:29)\n at next (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:188:7)\n at cors (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:224:17)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:214:15)\n at originCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:219:13)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:199:9)\n at optionsCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:204:7)\n at Object.middleware (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:80:5) at new Promise () at processTicksAndRejections (node:internal/process/task_queues:105:5) at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Credentials with default options", + "status": "failed", + "duration": 1, + "failureMessages": [ + "Error: expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\nExpected number of calls: 2\nReceived number of calls: 1\n at toHaveBeenCalledTimes (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:94:29)\n at next (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:188:7)\n at cors (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:224:17)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:214:15)\n at originCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:219:13)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:199:9)\n at optionsCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:204:7)\n at Object.middleware (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:92:5) at new Promise () at processTicksAndRejections (node:internal/process/task_queues:105:5) at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Credentials with custom options", + "status": "failed", + "duration": 1, + "failureMessages": [ + "Error: expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\nExpected number of calls: 3\nReceived number of calls: 2\n at toHaveBeenCalledTimes (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:107:29)\n at next (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:188:7)\n at cors (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:224:17)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:214:15)\n at originCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:219:13)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:199:9)\n at optionsCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:204:7)\n at Object.middleware (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:105:5) at new Promise () at processTicksAndRejections (node:internal/process/task_queues:105:5) at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + }, + { + "name": "middlewareWrapper should handle preflight request with default options", + "status": "failed", + "duration": 5003, + "failureMessages": [ + "Error: thrown: \"Exceeded timeout of 5000 ms for a test while waiting for `done()` to be called.\nAdd a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout.\"\n at test (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:113:3) at Object.describe (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:17:1) at processTicksAndRejections (node:internal/process/task_queues:105:5) at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + }, + { + "name": "middlewareWrapper should handle preflight request with custom options", + "status": "failed", + "duration": 4482, + "failureMessages": [ + "Error: thrown: \"Exceeded timeout of 5000 ms for a test while waiting for `done()` to be called.\nAdd a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout.\"\n at test (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:126:3) at Object.describe (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:17:1) at processTicksAndRejections (node:internal/process/task_queues:105:5) at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + }, + { + "name": "middlewareWrapper should handle error", + "status": "failed", + "duration": 4, + "failureMessages": [ + "Error: expect(received).toBe(expected) // Object.is equality\n\nExpected: [Error: Test error]\nReceived: undefined\n at toBe (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:146:19)\n at next (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:188:7)\n at cors (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:224:17)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:214:15)\n at originCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:219:13)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:199:9)\n at optionsCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:204:7)\n at Object.middleware (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:145:5) at new Promise () at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + } + ], + "errors": [ + "● middlewareWrapper › should call next with no options\n\n expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\n Expected number of calls: 1\n Received number of calls: 0\n\n 31 | middleware(req, res, (err) => {\n 32 | expect(err).toBeFalsy();\n > 33 | expect(mockNext).toHaveBeenCalledTimes(1);\n | ^\n 34 | done();\n 35 | });\n 36 | });" + ] + } + ], + "coverageSummary": { + "available": true, + "note": "Coverage map present in results" + }, + "rawStderr": "FAIL lib/index.auto.test.js (9.992 s)\n middlewareWrapper\n ✓ should exist (3 ms)\n ✓ should return a function (1 ms)\n ✕ should call next with no options (3 ms)\n ✓ should set Access-Control-Allow-Origin with default options (2 ms)\n ✕ should set Access-Control-Allow-Origin with custom options (2 ms)\n ✕ should set Access-Control-Allow-Methods with default options (5 ms)\n ✕ should set Access-Control-Allow-Methods with custom options (1 ms)\n ✕ should set Access-Control-Allow-Credentials with default options (1 ms)\n ✕ should set Access-Control-Allow-Credentials with custom options (1 ms)\n ✕ should handle preflight request with default options (5003 ms)\n ✕ should handle preflight request with custom options (4482 ms)\n ✕ should handle error (4 ms)\n\n ● middlewareWrapper › should call next with no options\n\n expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\n Expected number of calls: 1\n Received number of calls: 0\n\n 31 | middleware(req, res, (err) => {\n 32 | expect(err).toBeFalsy();\n > 33 | expect(mockNext).toHaveBeenCalledTimes(1);\n | ^\n 34 | done();\n 35 | });\n 36 | });\n\n at toHaveBeenCalledTimes (lib/index.auto.test.js:33:24)\n at next (lib/index.js:188:7)\n at cors (lib/index.js:224:17)\n at cb (lib/index.js:214:15)\n at originCallback (lib/index.js:219:13)\n at cb (lib/index.js:199:9)\n at optionsCallback (lib/index.js:204:7)\n at Object.middleware (lib/index.auto.test.js:31:5)\n\n ● middlewareWrapper › should set Access-Control-Allow-Origin with custom options\n\n expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\n Expected number of calls: 1\n Received number of calls: 2\n\n 55 | middleware(req, res, (err) => {\n 56 | expect(err).toBeFalsy();\n > 57 | expect(res.setHeader).toHaveBeenCalledTimes(1);\n | ^\n 58 | expect(res.setHeader).toHaveBeenCalledWith('Access-Control-Allow-Origin', 'http://example.com');\n 59 | done();\n 60 | });\n\n at toHaveBeenCalledTimes (lib/index.auto.test.js:57:29)\n at next (lib/index.js:188:7)\n at cors (lib/index.js:224:17)\n at cb (lib/index.js:214:15)\n at originCallback (lib/index.js:219:13)\n at cb (lib/index.js:199:9)\n at optionsCallback (lib/index.js:204:7)\n at Object.middleware (lib/index.auto.test.js:55:5)\n\n ● middlewareWrapper › should set Access-Control-Allow-Methods with default options\n\n expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\n Expected number of calls: 2\n Received number of calls: 1\n\n 67 | middleware(req, res, (err) => {\n 68 | expect(err).toBeFalsy();\n > 69 | expect(res.setHeader).toHaveBeenCalledTimes(2);\n | ^\n 70 | expect(res.setHeader).toHaveBeenCalledWith('Access-Control-Allow-Methods', 'GET,HEAD,PUT,PATCH,POST,DELETE');\n 71 | done();\n 72 | });\n\n at toHaveBeenCalledTimes (lib/index.auto.test.js:69:29)\n at next (lib/index.js:188:7)\n at cors (lib/index.js:224:17)\n at cb (lib/index.js:214:15)\n at originCallback (lib/index.js:219:13)\n at cb (lib/index.js:199:9)\n at optionsCallback (lib/index.js:204:7)\n at Object.middleware (lib/index.auto.test.js:67:5)\n\n ● middlewareWrapper › should set Access-Control-Allow-Methods with custom options\n\n expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\n Expected number of calls: 2\n Received number of calls: 1\n\n 80 | middleware(req, res, (err) => {\n 81 | expect(err).toBeFalsy();\n > 82 | expect(res.setHeader).toHaveBeenCalledTimes(2);\n | ^\n 83 | expect(res.setHeader).toHaveBeenCalledWith('Access-Control-Allow-Methods', 'GET,POST');\n 84 | done();\n 85 | });\n\n at toHaveBeenCalledTimes (lib/index.auto.test.js:82:29)\n at next (lib/index.js:188:7)\n at cors (lib/index.js:224:17)\n at cb (lib/index.js:214:15)\n at originCallback (lib/index.js:219:13)\n at cb (lib/index.js:199:9)\n at optionsCallback (lib/index.js:204:7)\n at Object.middleware (lib/index.auto.test.js:80:5)\n\n ● middlewareWrapper › should set Access-Control-Allow-Credentials with default options\n\n expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\n Expected number of calls: 2\n Received number of calls: 1\n\n 92 | middleware(req, res, (err) => {\n 93 | expect(err).toBeFalsy();\n > 94 | expect(res.setHeader).toHaveBeenCalledTimes(2);\n | ^\n 95 | expect(res.setHeader).not.toHaveBeenCalledWith('Access-Control-Allow-Credentials');\n 96 | done();\n 97 | });\n\n at toHaveBeenCalledTimes (lib/index.auto.test.js:94:29)\n at next (lib/index.js:188:7)\n at cors (lib/index.js:224:17)\n at cb (lib/index.js:214:15)\n at originCallback (lib/index.js:219:13)\n at cb (lib/index.js:199:9)\n at optionsCallback (lib/index.js:204:7)\n at Object.middleware (lib/index.auto.test.js:92:5)\n\n ● middlewareWrapper › should set Access-Control-Allow-Credentials with custom options\n\n expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\n Expected number of calls: 3\n Received number of calls: 2\n\n 105 | middleware(req, res, (err) => {\n 106 | expect(err).toBeFalsy();\n > 107 | expect(res.setHeader).toHaveBeenCalledTimes(3);\n | ^\n 108 | expect(res.setHeader).toHaveBeenCalledWith('Access-Control-Allow-Credentials', 'true');\n 109 | done();\n 110 | });\n\n at toHaveBeenCalledTimes (lib/index.auto.test.js:107:29)\n at next (lib/index.js:188:7)\n at cors (lib/index.js:224:17)\n at cb (lib/index.js:214:15)\n at originCallback (lib/index.js:219:13)\n at cb (lib/index.js:199:9)\n at optionsCallback (lib/index.js:204:7)\n at Object.middleware (lib/index.auto.test.js:105:5)\n\n ● middlewareWrapper › should handle preflight request with default options\n\n thrown: \"Exceeded timeout of 5000 ms for a test while waiting for `done()` to be called.\n Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout.\"\n\n 111 | });\n 112 |\n > 113 | test('should handle preflight request with default options', (done) => {\n | ^\n 114 | const middleware = middlewareWrapper();\n 115 | const req = mockReq({ method: 'OPTIONS', headers: { 'Access-Control-Request-Method': 'GET' } });\n 116 | const res = mockRes();\n\n at test (lib/index.auto.test.js:113:3)\n at Object.describe (lib/index.auto.test.js:17:1)\n\n ● middlewareWrapper › should handle preflight request with custom options\n\n thrown: \"Exceeded timeout of 5000 ms for a test while waiting for `done()` to be called.\n Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout.\"\n\n 124 | });\n 125 |\n > 126 | test('should handle preflight request with custom options', (done) => {\n | ^\n 127 | const options = { methods: 'GET,POST', credentials: true };\n 128 | const middleware = middlewareWrapper(options);\n 129 | const req = mockReq({ method: 'OPTIONS', headers: { 'Access-Control-Request-Method': 'GET' } });\n\n at test (lib/index.auto.test.js:126:3)\n at Object.describe (lib/index.auto.test.js:17:1)\n\n ● middlewareWrapper › should handle error\n\n expect(received).toBe(expected) // Object.is equality\n\n Expected: [Error: Test error]\n Received: undefined\n\n 144 | const error = new Error('Test error');\n 145 | middleware(req, res, (err) => {\n > 146 | expect(err).toBe(error);\n | ^\n 147 | done();\n 148 | });\n 149 | throw error;\n\n at toBe (lib/index.auto.test.js:146:19)\n at next (lib/index.js:188:7)\n at cors (lib/index.js:224:17)\n at cb (lib/index.js:214:15)\n at originCallback (lib/index.js:219:13)\n at cb (lib/index.js:199:9)\n at optionsCallback (lib/index.js:204:7)\n at Object.middleware (lib/index.auto.test.js:145:5)\n\nTest Suites: 1 failed, 1 total\nTests: 9 failed, 3 passed, 12 total\nSnapshots: 0 total\nTime: 10.048 s\nRan all test suites.\nTest results written to: __jest_results__.json" +} \ No newline at end of file diff --git a/run_2_results.json b/run_2_results.json new file mode 100644 index 0000000..d46fe9b --- /dev/null +++ b/run_2_results.json @@ -0,0 +1,120 @@ +{ + "success": false, + "totalSuites": 1, + "passedSuites": 0, + "failedSuites": 1, + "totalTests": 12, + "passed": 3, + "failed": 9, + "skipped": 0, + "pending": 0, + "duration": 10572, + "runtimeErrors": [], + "testFileResults": [ + { + "file": "/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js", + "status": "failed", + "duration": 10481, + "tests": [ + { + "name": "middlewareWrapper should exist", + "status": "passed", + "duration": 3, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should return a function", + "status": "passed", + "duration": 1, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should call next with no options", + "status": "failed", + "duration": 3, + "failureMessages": [ + "Error: expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\nExpected number of calls: 2\nReceived number of calls: 1\n at toHaveBeenCalledTimes (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:33:29)\n at next (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:188:7)\n at cors (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:224:17)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:214:15)\n at originCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:219:13)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:199:9)\n at optionsCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:204:7)\n at Object.middleware (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:31:5) at new Promise () at processTicksAndRejections (node:internal/process/task_queues:105:5) at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Origin with default options", + "status": "failed", + "duration": 5, + "failureMessages": [ + "Error: expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\nExpected number of calls: 2\nReceived number of calls: 1\n at toHaveBeenCalledTimes (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:45:29)\n at next (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:188:7)\n at cors (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:224:17)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:214:15)\n at originCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:219:13)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:199:9)\n at optionsCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:204:7)\n at Object.middleware (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:43:5) at new Promise () at processTicksAndRejections (node:internal/process/task_queues:105:5) at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Origin with custom options", + "status": "passed", + "duration": 2, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Methods with default options", + "status": "failed", + "duration": 1, + "failureMessages": [ + "Error: expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\nExpected number of calls: 2\nReceived number of calls: 1\n at toHaveBeenCalledTimes (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:70:29)\n at next (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:188:7)\n at cors (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:224:17)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:214:15)\n at originCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:219:13)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:199:9)\n at optionsCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:204:7)\n at Object.middleware (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:68:5) at new Promise () at processTicksAndRejections (node:internal/process/task_queues:105:5) at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Methods with custom options", + "status": "failed", + "duration": 1, + "failureMessages": [ + "Error: expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\nExpected number of calls: 2\nReceived number of calls: 1\n at toHaveBeenCalledTimes (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:83:29)\n at next (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:188:7)\n at cors (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:224:17)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:214:15)\n at originCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:219:13)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:199:9)\n at optionsCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:204:7)\n at Object.middleware (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:81:5) at new Promise () at processTicksAndRejections (node:internal/process/task_queues:105:5) at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Credentials with default options", + "status": "failed", + "duration": 1, + "failureMessages": [ + "Error: expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\nExpected number of calls: 2\nReceived number of calls: 1\n at toHaveBeenCalledTimes (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:95:29)\n at next (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:188:7)\n at cors (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:224:17)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:214:15)\n at originCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:219:13)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:199:9)\n at optionsCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:204:7)\n at Object.middleware (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:93:5) at new Promise () at processTicksAndRejections (node:internal/process/task_queues:105:5) at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Credentials with custom options", + "status": "failed", + "duration": 2, + "failureMessages": [ + "Error: expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\nExpected number of calls: 3\nReceived number of calls: 2\n at toHaveBeenCalledTimes (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:108:29)\n at next (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:188:7)\n at cors (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:224:17)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:214:15)\n at originCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:219:13)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:199:9)\n at optionsCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:204:7)\n at Object.middleware (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:106:5) at new Promise () at processTicksAndRejections (node:internal/process/task_queues:105:5) at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + }, + { + "name": "middlewareWrapper should handle preflight request with default options", + "status": "failed", + "duration": 5001, + "failureMessages": [ + "Error: thrown: \"Exceeded timeout of 5000 ms for a test while waiting for `done()` to be called.\nAdd a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout.\"\n at test (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:114:3) at Object.describe (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:17:1) at processTicksAndRejections (node:internal/process/task_queues:105:5) at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + }, + { + "name": "middlewareWrapper should handle preflight request with custom options", + "status": "failed", + "duration": 5007, + "failureMessages": [ + "Error: thrown: \"Exceeded timeout of 5000 ms for a test while waiting for `done()` to be called.\nAdd a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout.\"\n at test (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:127:3) at Object.describe (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:17:1) at processTicksAndRejections (node:internal/process/task_queues:105:5) at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + }, + { + "name": "middlewareWrapper should handle error", + "status": "failed", + "duration": 4, + "failureMessages": [ + "Error: expect(received).toBe(expected) // Object.is equality\n\nExpected: [Error: Test error]\nReceived: undefined\n at toBe (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:147:19)\n at next (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:188:7)\n at cors (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:224:17)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:214:15)\n at originCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:219:13)\n at cb (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:199:9)\n at optionsCallback (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.js:204:7)\n at Object.middleware (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:146:5) at new Promise () at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + } + ], + "errors": [ + "● middlewareWrapper › should call next with no options\n\n expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\n Expected number of calls: 2\n Received number of calls: 1\n\n 31 | middleware(req, res, (err) => {\n 32 | expect(err).toBeFalsy();\n > 33 | expect(res.setHeader).toHaveBeenCalledTimes(2);\n | ^\n 34 | expect(res.setHeader).toHaveBeenCalledWith('Access-Control-Allow-Origin', '*');\n 35 | done();\n 36 | });" + ] + } + ], + "coverageSummary": { + "available": true, + "note": "Coverage map present in results" + }, + "rawStderr": "FAIL lib/index.auto.test.js (10.481 s)\n middlewareWrapper\n ✓ should exist (3 ms)\n ✓ should return a function (1 ms)\n ✕ should call next with no options (3 ms)\n ✕ should set Access-Control-Allow-Origin with default options (5 ms)\n ✓ should set Access-Control-Allow-Origin with custom options (2 ms)\n ✕ should set Access-Control-Allow-Methods with default options (1 ms)\n ✕ should set Access-Control-Allow-Methods with custom options (1 ms)\n ✕ should set Access-Control-Allow-Credentials with default options (1 ms)\n ✕ should set Access-Control-Allow-Credentials with custom options (2 ms)\n ✕ should handle preflight request with default options (5001 ms)\n ✕ should handle preflight request with custom options (5007 ms)\n ✕ should handle error (4 ms)\n\n ● middlewareWrapper › should call next with no options\n\n expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\n Expected number of calls: 2\n Received number of calls: 1\n\n 31 | middleware(req, res, (err) => {\n 32 | expect(err).toBeFalsy();\n > 33 | expect(res.setHeader).toHaveBeenCalledTimes(2);\n | ^\n 34 | expect(res.setHeader).toHaveBeenCalledWith('Access-Control-Allow-Origin', '*');\n 35 | done();\n 36 | });\n\n at toHaveBeenCalledTimes (lib/index.auto.test.js:33:29)\n at next (lib/index.js:188:7)\n at cors (lib/index.js:224:17)\n at cb (lib/index.js:214:15)\n at originCallback (lib/index.js:219:13)\n at cb (lib/index.js:199:9)\n at optionsCallback (lib/index.js:204:7)\n at Object.middleware (lib/index.auto.test.js:31:5)\n\n ● middlewareWrapper › should set Access-Control-Allow-Origin with default options\n\n expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\n Expected number of calls: 2\n Received number of calls: 1\n\n 43 | middleware(req, res, (err) => {\n 44 | expect(err).toBeFalsy();\n > 45 | expect(res.setHeader).toHaveBeenCalledTimes(2);\n | ^\n 46 | expect(res.setHeader).toHaveBeenCalledWith('Access-Control-Allow-Origin', '*');\n 47 | done();\n 48 | });\n\n at toHaveBeenCalledTimes (lib/index.auto.test.js:45:29)\n at next (lib/index.js:188:7)\n at cors (lib/index.js:224:17)\n at cb (lib/index.js:214:15)\n at originCallback (lib/index.js:219:13)\n at cb (lib/index.js:199:9)\n at optionsCallback (lib/index.js:204:7)\n at Object.middleware (lib/index.auto.test.js:43:5)\n\n ● middlewareWrapper › should set Access-Control-Allow-Methods with default options\n\n expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\n Expected number of calls: 2\n Received number of calls: 1\n\n 68 | middleware(req, res, (err) => {\n 69 | expect(err).toBeFalsy();\n > 70 | expect(res.setHeader).toHaveBeenCalledTimes(2);\n | ^\n 71 | expect(res.setHeader).toHaveBeenCalledWith('Access-Control-Allow-Methods', 'GET,HEAD,PUT,PATCH,POST,DELETE');\n 72 | done();\n 73 | });\n\n at toHaveBeenCalledTimes (lib/index.auto.test.js:70:29)\n at next (lib/index.js:188:7)\n at cors (lib/index.js:224:17)\n at cb (lib/index.js:214:15)\n at originCallback (lib/index.js:219:13)\n at cb (lib/index.js:199:9)\n at optionsCallback (lib/index.js:204:7)\n at Object.middleware (lib/index.auto.test.js:68:5)\n\n ● middlewareWrapper › should set Access-Control-Allow-Methods with custom options\n\n expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\n Expected number of calls: 2\n Received number of calls: 1\n\n 81 | middleware(req, res, (err) => {\n 82 | expect(err).toBeFalsy();\n > 83 | expect(res.setHeader).toHaveBeenCalledTimes(2);\n | ^\n 84 | expect(res.setHeader).toHaveBeenCalledWith('Access-Control-Allow-Methods', 'GET,POST');\n 85 | done();\n 86 | });\n\n at toHaveBeenCalledTimes (lib/index.auto.test.js:83:29)\n at next (lib/index.js:188:7)\n at cors (lib/index.js:224:17)\n at cb (lib/index.js:214:15)\n at originCallback (lib/index.js:219:13)\n at cb (lib/index.js:199:9)\n at optionsCallback (lib/index.js:204:7)\n at Object.middleware (lib/index.auto.test.js:81:5)\n\n ● middlewareWrapper › should set Access-Control-Allow-Credentials with default options\n\n expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\n Expected number of calls: 2\n Received number of calls: 1\n\n 93 | middleware(req, res, (err) => {\n 94 | expect(err).toBeFalsy();\n > 95 | expect(res.setHeader).toHaveBeenCalledTimes(2);\n | ^\n 96 | expect(res.setHeader).not.toHaveBeenCalledWith('Access-Control-Allow-Credentials');\n 97 | done();\n 98 | });\n\n at toHaveBeenCalledTimes (lib/index.auto.test.js:95:29)\n at next (lib/index.js:188:7)\n at cors (lib/index.js:224:17)\n at cb (lib/index.js:214:15)\n at originCallback (lib/index.js:219:13)\n at cb (lib/index.js:199:9)\n at optionsCallback (lib/index.js:204:7)\n at Object.middleware (lib/index.auto.test.js:93:5)\n\n ● middlewareWrapper › should set Access-Control-Allow-Credentials with custom options\n\n expect(jest.fn()).toHaveBeenCalledTimes(expected)\n\n Expected number of calls: 3\n Received number of calls: 2\n\n 106 | middleware(req, res, (err) => {\n 107 | expect(err).toBeFalsy();\n > 108 | expect(res.setHeader).toHaveBeenCalledTimes(3);\n | ^\n 109 | expect(res.setHeader).toHaveBeenCalledWith('Access-Control-Allow-Credentials', 'true');\n 110 | done();\n 111 | });\n\n at toHaveBeenCalledTimes (lib/index.auto.test.js:108:29)\n at next (lib/index.js:188:7)\n at cors (lib/index.js:224:17)\n at cb (lib/index.js:214:15)\n at originCallback (lib/index.js:219:13)\n at cb (lib/index.js:199:9)\n at optionsCallback (lib/index.js:204:7)\n at Object.middleware (lib/index.auto.test.js:106:5)\n\n ● middlewareWrapper › should handle preflight request with default options\n\n thrown: \"Exceeded timeout of 5000 ms for a test while waiting for `done()` to be called.\n Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout.\"\n\n 112 | });\n 113 |\n > 114 | test('should handle preflight request with default options', (done) => {\n | ^\n 115 | const middleware = middlewareWrapper();\n 116 | const req = mockReq({ method: 'OPTIONS', headers: { 'Access-Control-Request-Method': 'GET' } });\n 117 | const res = mockRes();\n\n at test (lib/index.auto.test.js:114:3)\n at Object.describe (lib/index.auto.test.js:17:1)\n\n ● middlewareWrapper › should handle preflight request with custom options\n\n thrown: \"Exceeded timeout of 5000 ms for a test while waiting for `done()` to be called.\n Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout.\"\n\n 125 | });\n 126 |\n > 127 | test('should handle preflight request with custom options', (done) => {\n | ^\n 128 | const options = { methods: 'GET,POST', credentials: true };\n 129 | const middleware = middlewareWrapper(options);\n 130 | const req = mockReq({ method: 'OPTIONS', headers: { 'Access-Control-Request-Method': 'GET' } });\n\n at test (lib/index.auto.test.js:127:3)\n at Object.describe (lib/index.auto.test.js:17:1)\n\n ● middlewareWrapper › should handle error\n\n expect(received).toBe(expected) // Object.is equality\n\n Expected: [Error: Test error]\n Received: undefined\n\n 145 | const error = new Error('Test error');\n 146 | middleware(req, res, (err) => {\n > 147 | expect(err).toBe(error);\n | ^\n 148 | done();\n 149 | });\n 150 | throw error;\n\n at toBe (lib/index.auto.test.js:147:19)\n at next (lib/index.js:188:7)\n at cors (lib/index.js:224:17)\n at cb (lib/index.js:214:15)\n at originCallback (lib/index.js:219:13)\n at cb (lib/index.js:199:9)\n at optionsCallback (lib/index.js:204:7)\n at Object.middleware (lib/index.auto.test.js:146:5)\n\nTest Suites: 1 failed, 1 total\nTests: 9 failed, 3 passed, 12 total\nSnapshots: 0 total\nTime: 10.54 s\nRan all test suites.\nTest results written to: __jest_results__.json" +} \ No newline at end of file diff --git a/run_3_results.json b/run_3_results.json new file mode 100644 index 0000000..7f95b76 --- /dev/null +++ b/run_3_results.json @@ -0,0 +1,112 @@ +{ + "success": false, + "totalSuites": 1, + "passedSuites": 0, + "failedSuites": 1, + "totalTests": 13, + "passed": 11, + "failed": 2, + "skipped": 0, + "pending": 0, + "duration": 10554, + "runtimeErrors": [], + "testFileResults": [ + { + "file": "/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js", + "status": "failed", + "duration": 10472, + "tests": [ + { + "name": "middlewareWrapper should exist", + "status": "passed", + "duration": 3, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should return a function", + "status": "passed", + "duration": 1, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should call next with no options (GET request)", + "status": "passed", + "duration": 3, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Origin with default options (GET request)", + "status": "passed", + "duration": 1, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Origin with custom options (GET request)", + "status": "passed", + "duration": 2, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should NOT set Access-Control-Allow-Methods for a non-OPTIONS request with default options (GET request)", + "status": "passed", + "duration": 1, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should NOT set Access-Control-Allow-Methods for a non-OPTIONS request with custom options (GET request)", + "status": "passed", + "duration": 6, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should NOT set Access-Control-Allow-Credentials with default options (GET request)", + "status": "passed", + "duration": 1, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Credentials with custom options (GET request)", + "status": "passed", + "duration": 1, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should handle preflight request with default options", + "status": "failed", + "duration": 5002, + "failureMessages": [ + "Error: thrown: \"Exceeded timeout of 5000 ms for a test while waiting for `done()` to be called.\nAdd a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout.\"\n at test (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:120:3) at Object.describe (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:15:1) at processTicksAndRejections (node:internal/process/task_queues:105:5) at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + }, + { + "name": "middlewareWrapper should handle preflight request with custom options", + "status": "failed", + "duration": 5007, + "failureMessages": [ + "Error: thrown: \"Exceeded timeout of 5000 ms for a test while waiting for `done()` to be called.\nAdd a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout.\"\n at test (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:142:3) at Object.describe (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js:15:1) at processTicksAndRejections (node:internal/process/task_queues:105:5) at runTest (/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/node_modules/jest-runner/build/index.js:343:7)" + ] + }, + { + "name": "middlewareWrapper should handle error from options callback", + "status": "passed", + "duration": 3, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should handle error from origin callback", + "status": "passed", + "duration": 2, + "failureMessages": [] + } + ], + "errors": [ + "● middlewareWrapper › should handle preflight request with default options\n\n thrown: \"Exceeded timeout of 5000 ms for a test while waiting for `done()` to be called.\n Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout.\"\n\n 118 | });\n 119 |\n > 120 | test('should handle preflight request with default options', (done) => {\n | ^\n 121 | const middleware = middlewareWrapper();\n 122 | const req = mockReq({ method: 'OPTIONS', headers: { 'Access-Control-Request-Method': 'GET' } });\n 123 | const res = mockRes();\n\n at test (lib/index.auto.test.js:120:3)\n at Object.describe (lib/index.auto.test.js:15:1)" + ] + } + ], + "coverageSummary": { + "available": true, + "note": "Coverage map present in results" + }, + "rawStderr": "FAIL lib/index.auto.test.js (10.472 s)\n middlewareWrapper\n ✓ should exist (3 ms)\n ✓ should return a function (1 ms)\n ✓ should call next with no options (GET request) (3 ms)\n ✓ should set Access-Control-Allow-Origin with default options (GET request) (1 ms)\n ✓ should set Access-Control-Allow-Origin with custom options (GET request) (2 ms)\n ✓ should NOT set Access-Control-Allow-Methods for a non-OPTIONS request with default options (GET request) (1 ms)\n ✓ should NOT set Access-Control-Allow-Methods for a non-OPTIONS request with custom options (GET request) (6 ms)\n ✓ should NOT set Access-Control-Allow-Credentials with default options (GET request) (1 ms)\n ✓ should set Access-Control-Allow-Credentials with custom options (GET request) (1 ms)\n ✕ should handle preflight request with default options (5002 ms)\n ✕ should handle preflight request with custom options (5007 ms)\n ✓ should handle error from options callback (3 ms)\n ✓ should handle error from origin callback (2 ms)\n\n ● middlewareWrapper › should handle preflight request with default options\n\n thrown: \"Exceeded timeout of 5000 ms for a test while waiting for `done()` to be called.\n Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout.\"\n\n 118 | });\n 119 |\n > 120 | test('should handle preflight request with default options', (done) => {\n | ^\n 121 | const middleware = middlewareWrapper();\n 122 | const req = mockReq({ method: 'OPTIONS', headers: { 'Access-Control-Request-Method': 'GET' } });\n 123 | const res = mockRes();\n\n at test (lib/index.auto.test.js:120:3)\n at Object.describe (lib/index.auto.test.js:15:1)\n\n ● middlewareWrapper › should handle preflight request with custom options\n\n thrown: \"Exceeded timeout of 5000 ms for a test while waiting for `done()` to be called.\n Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout.\"\n\n 140 | });\n 141 |\n > 142 | test('should handle preflight request with custom options', (done) => {\n | ^\n 143 | const options = { methods: 'GET,POST', credentials: true };\n 144 | const middleware = middlewareWrapper(options);\n 145 | const req = mockReq({ method: 'OPTIONS', headers: { 'Access-Control-Request-Method': 'GET' } });\n\n at test (lib/index.auto.test.js:142:3)\n at Object.describe (lib/index.auto.test.js:15:1)\n\nTest Suites: 1 failed, 1 total\nTests: 2 failed, 11 passed, 13 total\nSnapshots: 0 total\nTime: 10.528 s\nRan all test suites.\nTest results written to: __jest_results__.json" +} \ No newline at end of file diff --git a/run_4_results.json b/run_4_results.json new file mode 100644 index 0000000..0cee090 --- /dev/null +++ b/run_4_results.json @@ -0,0 +1,29 @@ +{ + "success": false, + "totalSuites": 1, + "passedSuites": 0, + "failedSuites": 1, + "totalTests": 0, + "passed": 0, + "failed": 0, + "skipped": 0, + "pending": 0, + "duration": 395, + "runtimeErrors": [], + "testFileResults": [ + { + "file": "/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js", + "status": "failed", + "duration": 0, + "tests": [], + "errors": [ + "● Test suite failed to run\n\n SyntaxError: /home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js: Unterminated template. (198:1)\n\n 196 | });\n 197 | });\n > 198 | `,\n | ^\n 199 | \"fixDescription\": \"Fixed middleware tests to use correct done() callback pattern and updated expected header values based on the source code.\"\n 200 | } at parser.next () at normalizeFile.next () at run.next () at transform.next ()" + ] + } + ], + "coverageSummary": { + "available": true, + "note": "Coverage map present in results" + }, + "rawStderr": "FAIL lib/index.auto.test.js\n ● Test suite failed to run\n\n SyntaxError: /home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js: Unterminated template. (198:1)\n\n 196 | });\n 197 | });\n > 198 | `,\n | ^\n 199 | \"fixDescription\": \"Fixed middleware tests to use correct done() callback pattern and updated expected header values based on the source code.\"\n 200 | }\n\n at constructor (node_modules/@babel/parser/src/parse-error.ts:95:45)\n at Parser.toParseError [as raise] (node_modules/@babel/parser/src/tokenizer/index.ts:1504:19)\n at Object.raise [as unterminated] (node_modules/@babel/parser/src/tokenizer/index.ts:1625:18)\n at unterminated (node_modules/@babel/babel-helper-string-parser/src/index.ts:69:14)\n at Parser.readStringContents [as readTemplateToken] (node_modules/@babel/parser/src/tokenizer/index.ts:1365:7)\n at Parser.readTemplateToken [as getTokenFromCode] (node_modules/@babel/parser/src/tokenizer/index.ts:954:14)\n at Parser.getTokenFromCode [as nextToken] (node_modules/@babel/parser/src/tokenizer/index.ts:279:10)\n at Parser.nextToken [as next] (node_modules/@babel/parser/src/tokenizer/index.ts:122:10)\n at Parser.next [as eat] (node_modules/@babel/parser/src/tokenizer/index.ts:127:12)\n at Parser.eat [as isLineTerminator] (node_modules/@babel/parser/src/parser/util.ts:141:17)\n at Parser.isLineTerminator [as semicolon] (node_modules/@babel/parser/src/parser/util.ts:148:25)\n at Parser.semicolon [as parseExpressionStatement] (node_modules/@babel/parser/src/parser/statement.ts:1363:10)\n at Parser.parseExpressionStatement [as parseStatementContent] (node_modules/@babel/parser/src/parser/statement.ts:702:19)\n at Parser.parseStatementContent [as parseStatementLike] (node_modules/@babel/parser/src/parser/statement.ts:482:17)\n at Parser.parseStatementLike [as parseStatementListItem] (node_modules/@babel/parser/src/parser/statement.ts:431:17)\n at Parser.parseStatementListItem [as parseBlockOrModuleBlockBody] (node_modules/@babel/parser/src/parser/statement.ts:1444:16)\n at Parser.parseBlockOrModuleBlockBody [as parseBlockBody] (node_modules/@babel/parser/src/parser/statement.ts:1417:10)\n at Parser.parseBlockBody [as parseBlock] (node_modules/@babel/parser/src/parser/statement.ts:1385:10)\n at Parser.parseBlock [as parseFunctionBody] (node_modules/@babel/parser/src/parser/expression.ts:2618:24)\n at Parser.parseFunctionBody [as parseArrowExpression] (node_modules/@babel/parser/src/parser/expression.ts:2559:10)\n at Parser.parseArrowExpression [as parseParenAndDistinguishExpression] (node_modules/@babel/parser/src/parser/expression.ts:1847:12)\n at Parser.parseParenAndDistinguishExpression [as parseExprAtom] (node_modules/@babel/parser/src/parser/expression.ts:1170:21)\n at Parser.parseExprAtom [as parseExprSubscripts] (node_modules/@babel/parser/src/parser/expression.ts:742:23)\n at Parser.parseExprSubscripts [as parseUpdate] (node_modules/@babel/parser/src/parser/expression.ts:721:21)\n at Parser.parseUpdate [as parseMaybeUnary] (node_modules/@babel/parser/src/parser/expression.ts:683:23)\n at Parser.parseMaybeUnary [as parseMaybeUnaryOrPrivate] (node_modules/@babel/parser/src/parser/expression.ts:417:14)\n at Parser.parseMaybeUnaryOrPrivate [as parseExprOps] (node_modules/@babel/parser/src/parser/expression.ts:429:23)\n at Parser.parseExprOps [as parseMaybeConditional] (node_modules/@babel/parser/src/parser/expression.ts:384:23)\n at Parser.parseMaybeConditional [as parseMaybeAssign] (node_modules/@babel/parser/src/parser/expression.ts:301:21)\n at parseMaybeAssign (node_modules/@babel/parser/src/parser/expression.ts:257:12)\n at Parser.callback [as allowInAnd] (node_modules/@babel/parser/src/parser/expression.ts:3194:12)\n at Parser.allowInAnd [as parseMaybeAssignAllowIn] (node_modules/@babel/parser/src/parser/expression.ts:256:17)\n at Parser.parseMaybeAssignAllowIn [as parseMaybeAssignAllowInOrVoidPattern] (node_modules/@babel/parser/src/parser/expression.ts:3308:17)\n at Parser.parseMaybeAssignAllowInOrVoidPattern [as parseExprListItem] (node_modules/@babel/parser/src/parser/expression.ts:2790:18)\n at Parser.parseExprListItem [as parseCallExpressionArguments] (node_modules/@babel/parser/src/parser/expression.ts:1042:14)\n at Parser.parseCallExpressionArguments [as parseCoverCallAndAsyncArrowHead] (node_modules/@babel/parser/src/parser/expression.ts:922:29)\n at Parser.parseCoverCallAndAsyncArrowHead [as parseSubscript] (node_modules/@babel/parser/src/parser/expression.ts:804:19)\n at Parser.parseSubscript [as parseSubscripts] (node_modules/@babel/parser/src/parser/expression.ts:763:19)\n at Parser.parseSubscripts [as parseExprSubscripts] (node_modules/@babel/parser/src/parser/expression.ts:748:17)\n at Parser.parseExprSubscripts [as parseUpdate] (node_modules/@babel/parser/src/parser/expression.ts:721:21)\n at Parser.parseUpdate [as parseMaybeUnary] (node_modules/@babel/parser/src/parser/expression.ts:683:23)\n at Parser.parseMaybeUnary [as parseMaybeUnaryOrPrivate] (node_modules/@babel/parser/src/parser/expression.ts:417:14)\n at Parser.parseMaybeUnaryOrPrivate [as parseExprOps] (node_modules/@babel/parser/src/parser/expression.ts:429:23)\n at Parser.parseExprOps [as parseMaybeConditional] (node_modules/@babel/parser/src/parser/expression.ts:384:23)\n at Parser.parseMaybeConditional [as parseMaybeAssign] (node_modules/@babel/parser/src/parser/expression.ts:301:21)\n at Parser.parseMaybeAssign [as parseExpressionBase] (node_modules/@babel/parser/src/parser/expression.ts:226:23)\n at parseExpressionBase (node_modules/@babel/parser/src/parser/expression.ts:217:39)\n at Parser.callback [as allowInAnd] (node_modules/@babel/parser/src/parser/expression.ts:3189:16)\n at Parser.allowInAnd [as parseExpression] (node_modules/@babel/parser/src/parser/expression.ts:217:17)\n at Parser.parseExpression [as parseStatementContent] (node_modules/@babel/parser/src/parser/statement.ts:688:23)\n at Parser.parseStatementContent [as parseStatementLike] (node_modules/@babel/parser/src/parser/statement.ts:482:17)\n at Parser.parseStatementLike [as parseModuleItem] (node_modules/@babel/parser/src/parser/statement.ts:419:17)\n at Parser.parseModuleItem [as parseBlockOrModuleBlockBody] (node_modules/@babel/parser/src/parser/statement.ts:1443:16)\n at Parser.parseBlockOrModuleBlockBody [as parseBlockBody] (node_modules/@babel/parser/src/parser/statement.ts:1417:10)\n at Parser.parseBlockBody [as parseProgram] (node_modules/@babel/parser/src/parser/statement.ts:229:10)\n at Parser.parseProgram [as parseTopLevel] (node_modules/@babel/parser/src/parser/statement.ts:203:25)\n at Parser.parseTopLevel [as parse] (node_modules/@babel/parser/src/parser/index.ts:83:25)\n at parse (node_modules/@babel/parser/src/index.ts:86:38)\n at parser (node_modules/@babel/core/src/parser/index.ts:29:19)\n at parser.next ()\n at normalizeFile (node_modules/@babel/core/src/transformation/normalize-file.ts:50:24)\n at normalizeFile.next ()\n at run (node_modules/@babel/core/src/transformation/index.ts:41:36)\n at run.next ()\n at transform (node_modules/@babel/core/src/transform.ts:29:20)\n at transform.next ()\n at evaluateSync (node_modules/gensync/index.js:251:28)\n at sync (node_modules/gensync/index.js:89:14)\n at fn (node_modules/@babel/core/src/errors/rewrite-stack-trace.ts:99:14)\n at transformSync (node_modules/@babel/core/src/transform.ts:66:52)\n at ScriptTransformer.transformSource (node_modules/@jest/transform/build/index.js:422:31)\n at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/index.js:519:40)\n at ScriptTransformer.transform (node_modules/@jest/transform/build/index.js:558:19)\n\nTest Suites: 1 failed, 1 total\nTests: 0 total\nSnapshots: 0 total\nTime: 0.372 s\nRan all test suites.\nTest results written to: __jest_results__.json" +} \ No newline at end of file diff --git a/run_5_results.json b/run_5_results.json new file mode 100644 index 0000000..078914b --- /dev/null +++ b/run_5_results.json @@ -0,0 +1,106 @@ +{ + "success": true, + "totalSuites": 1, + "passedSuites": 1, + "failedSuites": 0, + "totalTests": 13, + "passed": 13, + "failed": 0, + "skipped": 0, + "pending": 0, + "duration": 535, + "runtimeErrors": [], + "testFileResults": [ + { + "file": "/home/sujeet/automation-engine/repo_workspace/session_cc9067321e80cb4d/cors/lib/index.auto.test.js", + "status": "passed", + "duration": 422, + "tests": [ + { + "name": "middlewareWrapper should exist", + "status": "passed", + "duration": 3, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should return a function", + "status": "passed", + "duration": 1, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should call next with no options (GET request)", + "status": "passed", + "duration": 3, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Origin with default options (GET request)", + "status": "passed", + "duration": 1, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Origin with custom options (GET request)", + "status": "passed", + "duration": 7, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should NOT set Access-Control-Allow-Methods for a non-OPTIONS request with default options (GET request)", + "status": "passed", + "duration": 1, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should NOT set Access-Control-Allow-Methods for a non-OPTIONS request with custom options (GET request)", + "status": "passed", + "duration": 1, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should NOT set Access-Control-Allow-Credentials with default options (GET request)", + "status": "passed", + "duration": 1, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should set Access-Control-Allow-Credentials with custom options (GET request)", + "status": "passed", + "duration": 2, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should handle preflight request with default options", + "status": "passed", + "duration": 2, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should handle preflight request with custom options", + "status": "passed", + "duration": 2, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should handle error from options callback", + "status": "passed", + "duration": 1, + "failureMessages": [] + }, + { + "name": "middlewareWrapper should handle error from origin callback", + "status": "passed", + "duration": 1, + "failureMessages": [] + } + ], + "errors": [] + } + ], + "coverageSummary": { + "available": true, + "note": "Coverage map present in results" + }, + "rawStderr": "" +} \ No newline at end of file