@natlibfi/fixugen-http-server 1.1.2-alpha.1 → 1.1.2-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _fixura = require("@natlibfi/fixura");
8
+ var _fixugen = _interopRequireDefault(require("@natlibfi/fixugen"));
9
+ var _chai = _interopRequireWildcard(require("chai"));
10
+ var _chaiHttp = _interopRequireDefault(require("chai-http"));
11
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ /**
15
+ *
16
+ * @licstart The following is the entire license notice for the JavaScript code in this file.
17
+ *
18
+ * Generate unit tests for HTTP servers with fixugen
19
+ *
20
+ * Copyright (C) 2020 University Of Helsinki (The National Library Of Finland)
21
+ *
22
+ * This file is part of fixugen-http-server-js
23
+ *
24
+ * fixugen-http-server-js program is free software: you can redistribute it and/or modify
25
+ * it under the terms of the GNU Affero General Public License as
26
+ * published by the Free Software Foundation, either version 3 of the
27
+ * License, or (at your option) any later version.
28
+ *
29
+ * fixugen-http-server-js is distributed in the hope that it will be useful,
30
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
31
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32
+ * GNU Affero General Public License for more details.
33
+ *
34
+ * You should have received a copy of the GNU Affero General Public License
35
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
36
+ *
37
+ * @licend The above is the entire license notice
38
+ * for the JavaScript code in this file.
39
+ *
40
+ */
41
+ var _default = ({
42
+ path,
43
+ recurse,
44
+ formatResponse = formatResponseDefault,
45
+ callback: createApp,
46
+ mocha = {}
47
+ }) => {
48
+ let requester; // eslint-disable-line functional/no-let
49
+
50
+ _chai.default.use(_chaiHttp.default);
51
+ (0, _fixugen.default)({
52
+ path,
53
+ recurse,
54
+ callback: httpCallback,
55
+ useMetadataFile: true,
56
+ fixura: {
57
+ failWhenNotFound: false
58
+ },
59
+ mocha: {
60
+ ...mocha,
61
+ afterEach: mochaAfterEach
62
+ }
63
+ });
64
+ async function mochaAfterEach() {
65
+ if (mocha.afterEach) {
66
+ await mocha.afterEach();
67
+ return closeRequester();
68
+ }
69
+ closeRequester();
70
+ function closeRequester() {
71
+ /* istanbul ignore else: Not easily tested */
72
+ if (requester) {
73
+ return requester.close();
74
+ }
75
+ }
76
+ }
77
+ async function httpCallback({
78
+ getFixtures,
79
+ requests,
80
+ ...options
81
+ }) {
82
+ const requestFixtures = getFixtures({
83
+ components: [/^request[0-9]+\..*$/u],
84
+ reader: _fixura.READERS.TEXT
85
+ });
86
+ const responseFixtures = getFixtures({
87
+ components: [/^response[0-9]+\..*$/u],
88
+ reader: _fixura.READERS.TEXT
89
+ });
90
+ const app = await createApp({
91
+ ...options,
92
+ requests
93
+ });
94
+ requester = _chai.default.request(app).keepOpen();
95
+ return iterate(requests);
96
+ async function iterate(testRequests, index = 0) {
97
+ const [testRequest] = testRequests.slice(0, 1);
98
+ if (testRequest) {
99
+ const {
100
+ method,
101
+ path,
102
+ status,
103
+ requestParams = {},
104
+ requestHeaders = {},
105
+ responseHeaders = {}
106
+ } = testRequest;
107
+ const requestPayload = requestFixtures[index];
108
+ const requestPath = path || '/';
109
+ const requestMethod = method.toLowerCase();
110
+ const request = requester[requestMethod](requestPath).buffer(true);
111
+ request.query(requestParams);
112
+ Object.entries(requestHeaders).forEach(([k, v]) => request.set(k, v));
113
+ const response = await request.send(requestPayload);
114
+ await handleResponse(response, status, responseHeaders);
115
+ return iterate(requests.slice(1), index + 1);
116
+ }
117
+ async function handleResponse(response, status, responseHeaders) {
118
+ const {
119
+ headers,
120
+ payload
121
+ } = await formatResponse(responseHeaders, response.text);
122
+ const expectedResponsePayload = responseFixtures[index];
123
+ (0, _chai.expect)(response).to.have.status(status);
124
+ Object.entries(headers).forEach(([key, value]) => (0, _chai.expect)(response).to.have.header(key, value));
125
+ if (expectedResponsePayload) {
126
+ return (0, _chai.expect)(payload).to.equal(expectedResponsePayload);
127
+ }
128
+ }
129
+ }
130
+ }
131
+ };
132
+ exports.default = _default;
133
+ function formatResponseDefault(headers, payload) {
134
+ return {
135
+ headers,
136
+ payload
137
+ };
138
+ }
139
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["path","recurse","formatResponse","formatResponseDefault","callback","createApp","mocha","requester","chai","use","chaiHttp","generateTests","httpCallback","useMetadataFile","fixura","failWhenNotFound","afterEach","mochaAfterEach","closeRequester","close","getFixtures","requests","options","requestFixtures","components","reader","READERS","TEXT","responseFixtures","app","request","keepOpen","iterate","testRequests","index","testRequest","slice","method","status","requestParams","requestHeaders","responseHeaders","requestPayload","requestPath","requestMethod","toLowerCase","buffer","query","Object","entries","forEach","k","v","set","response","send","handleResponse","headers","payload","text","expectedResponsePayload","expect","to","have","key","value","header","equal"],"sources":["../src/index.js"],"sourcesContent":["/**\n*\n* @licstart The following is the entire license notice for the JavaScript code in this file.\n*\n* Generate unit tests for HTTP servers with fixugen\n*\n* Copyright (C) 2020 University Of Helsinki (The National Library Of Finland)\n*\n* This file is part of fixugen-http-server-js\n*\n* fixugen-http-server-js program is free software: you can redistribute it and/or modify\n* it under the terms of the GNU Affero General Public License as\n* published by the Free Software Foundation, either version 3 of the\n* License, or (at your option) any later version.\n*\n* fixugen-http-server-js is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n* GNU Affero General Public License for more details.\n*\n* You should have received a copy of the GNU Affero General Public License\n* along with this program. If not, see <http://www.gnu.org/licenses/>.\n*\n* @licend The above is the entire license notice\n* for the JavaScript code in this file.\n*\n*/\n\nimport {READERS} from '@natlibfi/fixura';\nimport generateTests from '@natlibfi/fixugen';\nimport chai, {expect} from 'chai';\nimport chaiHttp from 'chai-http';\n\nexport default ({path, recurse, formatResponse = formatResponseDefault, callback: createApp, mocha = {}}) => {\n let requester; // eslint-disable-line functional/no-let\n\n chai.use(chaiHttp);\n\n generateTests({\n path, recurse,\n callback: httpCallback,\n useMetadataFile: true,\n fixura: {\n failWhenNotFound: false\n },\n mocha: {\n ...mocha,\n afterEach: mochaAfterEach\n }\n });\n\n async function mochaAfterEach() {\n if (mocha.afterEach) {\n await mocha.afterEach();\n return closeRequester();\n }\n\n closeRequester();\n\n function closeRequester() {\n /* istanbul ignore else: Not easily tested */\n if (requester) {\n return requester.close();\n }\n }\n }\n\n async function httpCallback({getFixtures, requests, ...options}) {\n const requestFixtures = getFixtures({\n components: [/^request[0-9]+\\..*$/u],\n reader: READERS.TEXT\n });\n\n const responseFixtures = getFixtures({\n components: [/^response[0-9]+\\..*$/u],\n reader: READERS.TEXT\n });\n\n const app = await createApp({...options, requests});\n\n requester = chai.request(app).keepOpen();\n\n return iterate(requests);\n\n async function iterate(testRequests, index = 0) {\n const [testRequest] = testRequests.slice(0, 1);\n\n if (testRequest) {\n const {\n method, path, status,\n requestParams = {}, requestHeaders = {}, responseHeaders = {}\n } = testRequest;\n\n const requestPayload = requestFixtures[index];\n const requestPath = path || '/';\n const requestMethod = method.toLowerCase();\n const request = requester[requestMethod](requestPath).buffer(true);\n\n request.query(requestParams);\n\n Object.entries(requestHeaders).forEach(([k, v]) => request.set(k, v));\n\n const response = await request.send(requestPayload);\n await handleResponse(response, status, responseHeaders);\n return iterate(requests.slice(1), index + 1);\n\n }\n\n async function handleResponse(response, status, responseHeaders) {\n const {headers, payload} = await formatResponse(responseHeaders, response.text);\n const expectedResponsePayload = responseFixtures[index];\n\n expect(response).to.have.status(status);\n\n Object.entries(headers).forEach(([key, value]) => expect(response).to.have.header(key, value));\n\n if (expectedResponsePayload) {\n return expect(payload).to.equal(expectedResponsePayload);\n }\n }\n }\n }\n};\n\nfunction formatResponseDefault(headers, payload) {\n return {headers, payload};\n}\n"],"mappings":";;;;;;AA4BA;AACA;AACA;AACA;AAAiC;AAAA;AAAA;AA/BjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA1BA,eAiCe,CAAC;EAACA,IAAI;EAAEC,OAAO;EAAEC,cAAc,GAAGC,qBAAqB;EAAEC,QAAQ,EAAEC,SAAS;EAAEC,KAAK,GAAG,CAAC;AAAC,CAAC,KAAK;EAC3G,IAAIC,SAAS,CAAC,CAAC;;EAEfC,aAAI,CAACC,GAAG,CAACC,iBAAQ,CAAC;EAElB,IAAAC,gBAAa,EAAC;IACZX,IAAI;IAAEC,OAAO;IACbG,QAAQ,EAAEQ,YAAY;IACtBC,eAAe,EAAE,IAAI;IACrBC,MAAM,EAAE;MACNC,gBAAgB,EAAE;IACpB,CAAC;IACDT,KAAK,EAAE;MACL,GAAGA,KAAK;MACRU,SAAS,EAA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,OAAO,IAAAC,YAAM,EAACH,OAAO,CAAC,CAACI,EAAE,CAACK,KAAK,CAACP,uBAAuB,CAAC;QAC1D;MACF;IACF;EACF;AACF,CAAC;AAAA;AAED,SAASzD,qBAAqB,CAACsD,OAAO,EAAEC,OAAO,EAAE;EAC/C,OAAO;IAACD,OAAO;IAAEC;EAAO,CAAC;AAC3B"}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ var _express = _interopRequireDefault(require("express"));
4
+ var _ = _interopRequireDefault(require("."));
5
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6
+ /**
7
+ *
8
+ * @licstart The following is the entire license notice for the JavaScript code in this file.
9
+ *
10
+ * Generate unit tests for HTTP servers with fixugen
11
+ *
12
+ * Copyright (C) 2020 University Of Helsinki (The National Library Of Finland)
13
+ *
14
+ * This file is part of fixugen-http-server-js
15
+ *
16
+ * fixugen-http-server-js program is free software: you can redistribute it and/or modify
17
+ * it under the terms of the GNU Affero General Public License as
18
+ * published by the Free Software Foundation, either version 3 of the
19
+ * License, or (at your option) any later version.
20
+ *
21
+ * fixugen-http-server-js is distributed in the hope that it will be useful,
22
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ * GNU Affero General Public License for more details.
25
+ *
26
+ * You should have received a copy of the GNU Affero General Public License
27
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
28
+ *
29
+ * @licend The above is the entire license notice
30
+ * for the JavaScript code in this file.
31
+ *
32
+ */
33
+
34
+ (0, _.default)({
35
+ recurse: false,
36
+ path: [__dirname, '..', 'test-fixtures'],
37
+ callback: ({
38
+ getFixture,
39
+ requests
40
+ }) => {
41
+ const app = (0, _express.default)();
42
+ return iterate(requests);
43
+ function iterate(requests, index = 0) {
44
+ const [request] = requests;
45
+ if (request) {
46
+ const {
47
+ method,
48
+ path,
49
+ status,
50
+ responseHeaders = {}
51
+ } = request;
52
+ const responsePayload = getFixture(`response${index}.txt`) || '';
53
+ app[method](path || '/', (req, res) => {
54
+ Object.entries(responseHeaders).forEach(([k, v]) => res.set(k, v));
55
+ if (responsePayload) {
56
+ return res.status(status).send(responsePayload);
57
+ }
58
+ res.sendStatus(status);
59
+ });
60
+ return iterate(requests.slice(1), index + 1);
61
+ }
62
+ return app.listen(1337);
63
+ }
64
+ }
65
+ });
66
+ //# sourceMappingURL=index.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.spec.js","names":["generateTests","recurse","path","__dirname","callback","getFixture","requests","app","express","iterate","index","request","method","status","responseHeaders","responsePayload","req","res","Object","entries","forEach","k","v","set","send","sendStatus","slice","listen"],"sources":["../src/index.spec.js"],"sourcesContent":["/**\n*\n* @licstart The following is the entire license notice for the JavaScript code in this file.\n*\n* Generate unit tests for HTTP servers with fixugen\n*\n* Copyright (C) 2020 University Of Helsinki (The National Library Of Finland)\n*\n* This file is part of fixugen-http-server-js\n*\n* fixugen-http-server-js program is free software: you can redistribute it and/or modify\n* it under the terms of the GNU Affero General Public License as\n* published by the Free Software Foundation, either version 3 of the\n* License, or (at your option) any later version.\n*\n* fixugen-http-server-js is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n* GNU Affero General Public License for more details.\n*\n* You should have received a copy of the GNU Affero General Public License\n* along with this program. If not, see <http://www.gnu.org/licenses/>.\n*\n* @licend The above is the entire license notice\n* for the JavaScript code in this file.\n*\n*/\n\nimport express from 'express';\nimport generateTests from '.';\n\ngenerateTests({\n recurse: false,\n path: [__dirname, '..', 'test-fixtures'],\n callback: ({getFixture, requests}) => {\n const app = express();\n return iterate(requests);\n\n function iterate(requests, index = 0) {\n const [request] = requests;\n\n if (request) {\n const {method, path, status, responseHeaders = {}} = request;\n const responsePayload = getFixture(`response${index}.txt`) || '';\n\n app[method](path || '/', (req, res) => {\n Object.entries(responseHeaders).forEach(([k, v]) => res.set(k, v));\n\n if (responsePayload) {\n return res.status(status).send(responsePayload);\n }\n\n res.sendStatus(status);\n });\n\n return iterate(requests.slice(1), index + 1);\n }\n\n return app.listen(1337);\n }\n }\n});\n"],"mappings":";;AA4BA;AACA;AAA8B;AA7B9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,IAAAA,SAAa,EAAC;EACZC,OAAO,EAAE,KAAK;EACdC,IAAI,EAAE,CAACC,SAAS,EAAE,IAAI,EAAE,eAAe,CAAC;EACxCC,QAAQ,EAAE,CAAC;IAACC,UAAU;IAAEC;EAAQ,CAAC,KAAK;IACpC,MAAMC,GAAG,GAAG,IAAAC,gBAAO,GAAE;IACrB,OAAOC,OAAO,CAACH,QAAQ,CAAC;IAExB,SAASG,OAAO,CAACH,QAAQ,EAAEI,KAAK,GAAG,CAAC,EAAE;MACpC,MAAM,CAACC,OAAO,CAAC,GAAGL,QAAQ;MAE1B,IAAIK,OAAO,EAAE;QACX,MAAM;UAACC,MAAM;UAAEV,IAAI;UAAEW,MAAM;UAAEC,eAAe,GAAG,CAAC;QAAC,CAAC,GAAGH,OAAO;QAC5D,MAAMI,eAAe,GAAGV,UAAU,CAAE,WAAUK,KAAM,MAAK,CAAC,IAAI,EAAE;QAEhEH,GAAG,CAACK,MAAM,CAAC,CAACV,IAAI,IAAI,GAAG,EAAE,CAACc,GAAG,EAAEC,GAAG,KAAK;UACrCC,MAAM,CAACC,OAAO,CAACL,eAAe,CAAC,CAACM,OAAO,CAAC,CAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,KAAKL,GAAG,CAACM,GAAG,CAACF,CAAC,EAAEC,CAAC,CAAC,CAAC;UAElE,IAAIP,eAAe,EAAE;YACnB,OAAOE,GAAG,CAACJ,MAAM,CAACA,MAAM,CAAC,CAACW,IAAI,CAACT,eAAe,CAAC;UACjD;UAEAE,GAAG,CAACQ,UAAU,CAACZ,MAAM,CAAC;QACxB,CAAC,CAAC;QAEF,OAAOJ,OAAO,CAACH,QAAQ,CAACoB,KAAK,CAAC,CAAC,CAAC,EAAEhB,KAAK,GAAG,CAAC,CAAC;MAC9C;MAEA,OAAOH,GAAG,CAACoB,MAAM,CAAC,IAAI,CAAC;IACzB;EACF;AACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "url": "git@github.com:natlibfi/fixugen-http-server-js.git"
15
15
  },
16
16
  "license": "LGPL-3.0+",
17
- "version": "1.1.2-alpha.1",
17
+ "version": "1.1.2-alpha.2",
18
18
  "main": "dist/index.js",
19
19
  "engines": {
20
20
  "node": ">=18"
@@ -23,6 +23,7 @@
23
23
  "access": "public"
24
24
  },
25
25
  "scripts": {
26
+ "prepare": "npm run build",
26
27
  "lint": "eslint src",
27
28
  "lint:dev": "eslint --fix src",
28
29
  "test:base": "cross-env NODE_ENV=test nyc mocha --require @babel/register",