@natlibfi/oracledb-mock 1.0.1 → 1.0.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.
@@ -10,7 +10,7 @@ updates:
10
10
  interval: "daily"
11
11
  time: "06:30"
12
12
  timezone: "Europe/Helsinki"
13
- target-branch: "dependencies"
13
+ target-branch: "test"
14
14
 
15
15
  # Minor updates to npm production dependencies daily
16
16
  - package-ecosystem: "npm"
@@ -20,9 +20,14 @@ updates:
20
20
  time: "06:45"
21
21
  timezone: "Europe/Helsinki"
22
22
  versioning-strategy: lockfile-only
23
- allow:
24
- - dependency-type: "production"
25
- target-branch: "dependencies"
23
+ target-branch: "test"
24
+ pull-request-branch-name:
25
+ separator: "-"
26
+ groups:
27
+ production-dependencies:
28
+ dependency-type: "production"
29
+ development-dependencies:
30
+ dependency-type: "development"
26
31
 
27
32
  # Major updates to npm dependencies weekly @tuesday
28
33
  # Not possible yet https://github.com/dependabot/dependabot-core/issues/1778
@@ -11,7 +11,7 @@ jobs:
11
11
 
12
12
  strategy:
13
13
  matrix:
14
- node-version: [18.x, 19.x]
14
+ node-version: [18.x, 19.x, 20.x]
15
15
  # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
16
16
 
17
17
  steps:
package/dist/index.js ADDED
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _deepEql = _interopRequireDefault(require("deep-eql"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ /**
10
+ *
11
+ * @licstart The following is the entire license notice for the JavaScript code in this file.
12
+ *
13
+ * A mock for oracledb Node.js module
14
+ *
15
+ * Copyright (C) 2020 University Of Helsinki (The National Library Of Finland)
16
+ *
17
+ * This file is part of oracledb-mock-js
18
+ *
19
+ * oracledb-mock-js program is free software: you can redistribute it and/or modify
20
+ * it under the terms of the GNU Affero General Public License as
21
+ * published by the Free Software Foundation, either version 3 of the
22
+ * License, or (at your option) any later version.
23
+ *
24
+ * oracledb-mock-js is distributed in the hope that it will be useful,
25
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
26
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27
+ * GNU Affero General Public License for more details.
28
+ *
29
+ * You should have received a copy of the GNU Affero General Public License
30
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
31
+ *
32
+ * @licend The above is the entire license notice
33
+ * for the JavaScript code in this file.
34
+ *
35
+ */
36
+ var _default = () => {
37
+ const options = [];
38
+ const DEFAULT_OPTIONS = {
39
+ queryPattern: /.*/u,
40
+ results: []
41
+ };
42
+ const connection = {
43
+ close: () => {},
44
+ // eslint-disable-line no-empty-function
45
+ break: () => {},
46
+ // eslint-disable-line no-empty-function
47
+ execute: (query, args) => {
48
+ const rows = getRows();
49
+ return {
50
+ resultSet: {
51
+ getRow: () => rows.shift(),
52
+ // eslint-disable-line functional/immutable-data
53
+ close: () => {} // eslint-disable-line no-empty-function
54
+ }
55
+ };
56
+ function getRows() {
57
+ const index = options.findIndex(({
58
+ queryPattern,
59
+ expectedArgs
60
+ }) => {
61
+ if (queryPattern.test(query) && (expectedArgs === undefined || (0, _deepEql.default)(args, expectedArgs))) {
62
+ return true;
63
+ }
64
+ return false;
65
+ });
66
+ if (index >= 0) {
67
+ const {
68
+ results
69
+ } = options.splice(index, 1).shift(); // eslint-disable-line functional/immutable-data
70
+ return results;
71
+ }
72
+ return [];
73
+ }
74
+ }
75
+ };
76
+ return {
77
+ getConnection: () => connection,
78
+ createPool: () => ({
79
+ getConnection: () => connection,
80
+ close: () => {} // eslint-disable-line no-empty-function
81
+ }),
82
+ _clear: () => {
83
+ // Clear array
84
+ options.splice(0); // eslint-disable-line functional/immutable-data
85
+ Object.keys(options).forEach(k => delete options[k]); // eslint-disable-line functional/immutable-data
86
+ },
87
+ _execute: optList => {
88
+ // Clear array
89
+ options.splice(0); // eslint-disable-line functional/immutable-data
90
+
91
+ optList.forEach(opts => {
92
+ options.push({
93
+ ...DEFAULT_OPTIONS,
94
+ ...opts
95
+ }); // eslint-disable-line functional/immutable-data
96
+ });
97
+ }
98
+ };
99
+ };
100
+ exports.default = _default;
101
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_deepEql","_interopRequireDefault","require","obj","__esModule","default","_default","options","DEFAULT_OPTIONS","queryPattern","results","connection","close","break","execute","query","args","rows","getRows","resultSet","getRow","shift","index","findIndex","expectedArgs","test","undefined","deepEqual","splice","getConnection","createPool","_clear","Object","keys","forEach","k","_execute","optList","opts","push","exports"],"sources":["../src/index.js"],"sourcesContent":["/**\n*\n* @licstart The following is the entire license notice for the JavaScript code in this file.\n*\n* A mock for oracledb Node.js module\n*\n* Copyright (C) 2020 University Of Helsinki (The National Library Of Finland)\n*\n* This file is part of oracledb-mock-js\n*\n* oracledb-mock-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* oracledb-mock-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 deepEqual from 'deep-eql';\n\nexport default () => {\n const options = [];\n const DEFAULT_OPTIONS = {\n queryPattern: /.*/u,\n results: []\n };\n\n const connection = {\n close: () => {}, // eslint-disable-line no-empty-function\n break: () => {}, // eslint-disable-line no-empty-function\n execute: (query, args) => {\n const rows = getRows();\n\n return {\n resultSet: {\n getRow: () => rows.shift(), // eslint-disable-line functional/immutable-data\n close: () => {} // eslint-disable-line no-empty-function\n }\n };\n\n function getRows() {\n const index = options.findIndex(({queryPattern, expectedArgs}) => {\n if (queryPattern.test(query) && (expectedArgs === undefined || deepEqual(args, expectedArgs))) {\n return true;\n }\n\n return false;\n });\n\n if (index >= 0) {\n const {results} = options.splice(index, 1).shift(); // eslint-disable-line functional/immutable-data\n return results;\n }\n\n return [];\n }\n }\n };\n\n return {\n getConnection: () => connection,\n createPool: () => ({\n getConnection: () => connection,\n close: () => {} // eslint-disable-line no-empty-function\n }),\n _clear: () => {\n // Clear array\n options.splice(0); // eslint-disable-line functional/immutable-data\n Object.keys(options).forEach(k => delete options[k]); // eslint-disable-line functional/immutable-data\n },\n _execute: optList => {\n // Clear array\n options.splice(0); // eslint-disable-line functional/immutable-data\n\n optList.forEach(opts => {\n options.push({...DEFAULT_OPTIONS, ...opts}); // eslint-disable-line functional/immutable-data\n });\n }\n };\n};\n"],"mappings":";;;;;;AA4BA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAiC,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AA5BjC;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,IAAAG,QAAA,GA8BeA,CAAA,KAAM;EACnB,MAAMC,OAAO,GAAG,EAAE;EAClB,MAAMC,eAAe,GAAG;IACtBC,YAAY,EAAE,KAAK;IACnBC,OAAO,EAAE;EACX,CAAC;EAED,MAAMC,UAAU,GAAG;IACjBC,KAAK,EAAEA,CAAA,KAAM,CAAC,CAAC;IAAE;IACjBC,KAAK,EAAEA,CAAA,KAAM,CAAC,CAAC;IAAE;IACjBC,OAAO,EAAEA,CAACC,KAAK,EAAEC,IAAI,KAAK;MACxB,MAAMC,IAAI,GAAGC,OAAO,CAAC,CAAC;MAEtB,OAAO;QACLC,SAAS,EA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AAO,CAACH,OAAO,CAACI,IAAI,IAAI;QACtB/B,OAAO,CAACgC,IAAI,CAAC;UAAC,GAAG/B,eAAe;UAAE,GAAG8B;QAAI,CAAC,CAAC,CAAC,CAAC;MAC/C,CAAC,CAAC;IACJ;EACF,CAAC;AACH,CAAC;AAAAE,OAAA,CAAAnC,OAAA,GAAAC,QAAA"}
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+
3
+ var _ = _interopRequireDefault(require("."));
4
+ var _fixugen = _interopRequireDefault(require("@natlibfi/fixugen"));
5
+ var _chai = require("chai");
6
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7
+ /**
8
+ *
9
+ * @licstart The following is the entire license notice for the JavaScript code in this file.
10
+ *
11
+ * A mock for oracledb Node.js module
12
+ *
13
+ * Copyright (C) 2020 University Of Helsinki (The National Library Of Finland)
14
+ *
15
+ * This file is part of oracledb-mock-js
16
+ *
17
+ * oracledb-mock-js program is free software: you can redistribute it and/or modify
18
+ * it under the terms of the GNU Affero General Public License as
19
+ * published by the Free Software Foundation, either version 3 of the
20
+ * License, or (at your option) any later version.
21
+ *
22
+ * oracledb-mock-js is distributed in the hope that it will be useful,
23
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
+ * GNU Affero General Public License for more details.
26
+ *
27
+ * You should have received a copy of the GNU Affero General Public License
28
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
29
+ *
30
+ * @licend The above is the entire license notice
31
+ * for the JavaScript code in this file.
32
+ *
33
+ */
34
+
35
+ (0, _fixugen.default)({
36
+ useMetadataFile: true,
37
+ path: [__dirname, '..', 'test-fixtures'],
38
+ callback: async ({
39
+ dbResults,
40
+ usePool = false,
41
+ expectedResults,
42
+ query,
43
+ args = {}
44
+ }) => {
45
+ const mock = (0, _.default)();
46
+ mock._execute(formatDbResults());
47
+ if (usePool) {
48
+ const pool = await mock.createPool();
49
+ const connection = await pool.getConnection();
50
+ const {
51
+ resultSet
52
+ } = await connection.execute(query, args);
53
+ const results = await fetchResults(resultSet);
54
+ (0, _chai.expect)(results).to.eql(expectedResults);
55
+ await connection.close();
56
+ await pool.close();
57
+ mock._clear();
58
+ return;
59
+ }
60
+ const connection = await mock.getConnection();
61
+ const {
62
+ resultSet
63
+ } = await connection.execute(query, args);
64
+ const results = await fetchResults(resultSet);
65
+ (0, _chai.expect)(results).to.eql(expectedResults);
66
+ await connection.close();
67
+ mock._clear();
68
+ async function fetchResults(resultSet, results = []) {
69
+ const row = await resultSet.getRow();
70
+ if (row) {
71
+ return fetchResults(resultSet, results.concat(row));
72
+ }
73
+ await resultSet.close();
74
+ return results;
75
+ }
76
+ function formatDbResults() {
77
+ return dbResults.map(({
78
+ queryPattern,
79
+ ...rest
80
+ }) => {
81
+ if (queryPattern) {
82
+ return {
83
+ ...rest,
84
+ queryPattern: new RegExp(queryPattern, 'u')
85
+ };
86
+ }
87
+ return rest;
88
+ });
89
+ }
90
+ }
91
+ });
92
+ //# sourceMappingURL=index.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.spec.js","names":["_","_interopRequireDefault","require","_fixugen","_chai","obj","__esModule","default","generateTests","useMetadataFile","path","__dirname","callback","dbResults","usePool","expectedResults","query","args","mock","createMock","_execute","formatDbResults","pool","createPool","connection","getConnection","resultSet","execute","results","fetchResults","expect","to","eql","close","_clear","row","getRow","concat","map","queryPattern","rest","RegExp"],"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* A mock for oracledb Node.js module\n*\n* Copyright (C) 2020 University Of Helsinki (The National Library Of Finland)\n*\n* This file is part of oracledb-mock-js\n*\n* oracledb-mock-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* oracledb-mock-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 createMock from '.';\nimport generateTests from '@natlibfi/fixugen';\nimport {expect} from 'chai';\n\ngenerateTests({\n useMetadataFile: true,\n path: [__dirname, '..', 'test-fixtures'],\n callback: async ({dbResults, usePool = false, expectedResults, query, args = {}}) => {\n const mock = createMock();\n\n mock._execute(formatDbResults());\n\n if (usePool) {\n const pool = await mock.createPool();\n const connection = await pool.getConnection();\n const {resultSet} = await connection.execute(query, args);\n const results = await fetchResults(resultSet);\n\n expect(results).to.eql(expectedResults);\n\n await connection.close();\n await pool.close();\n\n mock._clear();\n return;\n }\n\n const connection = await mock.getConnection();\n const {resultSet} = await connection.execute(query, args);\n const results = await fetchResults(resultSet);\n\n expect(results).to.eql(expectedResults);\n\n await connection.close();\n mock._clear();\n\n async function fetchResults(resultSet, results = []) {\n const row = await resultSet.getRow();\n\n if (row) {\n return fetchResults(resultSet, results.concat(row));\n }\n\n await resultSet.close();\n return results;\n }\n\n function formatDbResults() {\n return dbResults.map(({queryPattern, ...rest}) => {\n if (queryPattern) {\n return {\n ...rest,\n queryPattern: new RegExp(queryPattern, 'u')\n };\n }\n\n return rest;\n });\n }\n }\n});\n"],"mappings":";;AA4BA,IAAAA,CAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAA4B,SAAAD,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AA9B5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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vC,MAAMS,UAAU,CAACS,KAAK,CAAC,CAAC;IACxBf,IAAI,CAACgB,MAAM,CAAC,CAAC;IAEb,eAAeL,YAAYA,CAACH,SAAS,EAAEE,OAAO,GAAG,EAAE,EAAE;MACnD,MAAMO,GAAG,GAAG,MAAMT,SAAS,CAACU,MAAM,CAAC,CAAC;MAEpC,IAAID,GAAG,EAAE;QACP,OAAON,YAAY,CAACH,SAAS,EAAEE,OAAO,CAACS,MAAM,CAACF,GAAG,CAAC,CAAC;MACrD;MAEA,MAAMT,SAAS,CAACO,KAAK,CAAC,CAAC;MACvB,OAAOL,OAAO;IAChB;IAEA,SAASP,eAAeA,CAAA,EAAG;MACzB,OAAOR,SAAS,CAACyB,GAAG,CAAC,CAAC;QAACC,YAAY;QAAE,GAAGC;MAAI,CAAC,KAAK;QAChD,IAAID,YAAY,EAAE;UAChB,OAAO;YACL,GAAGC,IAAI;YACPD,YAAY,EAAE,IAAIE,MAAM,CAACF,YAAY,EAAE,GAAG;UAC5C,CAAC;QACH;QAEA,OAAOC,IAAI;MACb,CAAC,CAAC;IACJ;EACF;AACF,CAAC,CAAC"}
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "url": "git@github.com:natlibfi/oracledb-mock-js.git"
15
15
  },
16
16
  "license": "LGPL-3.0+",
17
- "version": "1.0.1",
17
+ "version": "1.0.2-alpha.2",
18
18
  "main": "./dist/index.js",
19
19
  "engines": {
20
20
  "node": ">=12"
@@ -23,34 +23,36 @@
23
23
  "access": "public"
24
24
  },
25
25
  "scripts": {
26
- "lint": "eslint src",
27
- "lint:dev": "eslint --fix src",
28
- "test:base": "cross-env NODE_ENV=test nyc mocha --require @babel/register",
29
- "test": "npm run lint && npm run test:base -- src/*.spec.js && npm run coverage",
30
- "test:dev": "npm run lint:dev && npm run test:base -- src/*.spec.js && npm run coverage",
31
- "coverage": "nyc check-coverage --per-file",
26
+ "prepare": "npm run build",
32
27
  "build": "babel src --source-maps --copy-files --delete-dir-on-start --out-dir=dist",
33
- "watch:test": "cross-env DEBUG=1 NODE_ENV=test nodemon -w src -w test-fixtures --exec 'npm run test:dev'"
28
+ "lint": "eslint ./src",
29
+ "lint:dev": "eslint --fix ./src",
30
+ "test": "npm run lint && npm run test:base",
31
+ "test:base": "cross-env NODE_ENV=test nyc mocha --package ./package.json",
32
+ "test:dev": "npm run lint:dev && npm run test:base",
33
+ "coverage": "nyc check-coverage --per-file",
34
+ "dev": "nodemon",
35
+ "dev:debug": "cross-env LOG_LEVEL=debug DEBUG=@natlibfi/* NODE_ENV=test nodemon",
36
+ "watch:test": "cross-env DEBUG=@natlibfi/* NODE_ENV=test nodemon -w src -w test-fixtures --exec 'npm run test:dev'"
34
37
  },
35
38
  "dependencies": {
36
- "deep-eql": "^4.0.0"
39
+ "deep-eql": "^4.1.3"
37
40
  },
38
41
  "devDependencies": {
39
- "@babel/cli": "^7.22.9",
40
- "@babel/core": "^7.22.9",
41
- "@babel/eslint-parser": "^7.22.9",
42
- "@babel/node": "^7.22.6",
43
- "@babel/preset-env": "^7.22.9",
44
- "@babel/register": "^7.22.5",
45
- "@natlibfi/eslint-config-melinda-backend": "^3.0.0",
46
- "@natlibfi/fixugen": "^2.0.0",
47
- "@natlibfi/fixura": "^3.0.0",
48
- "babel-plugin-istanbul": "^6.0.0",
49
- "chai": "^4.2.0",
50
- "cross-env": "^7.0.2",
51
- "eslint": "^8.45.0",
42
+ "@babel/cli": "^7.23.4",
43
+ "@babel/core": "^7.23.6",
44
+ "@babel/node": "^7.22.19",
45
+ "@babel/preset-env": "^7.23.6",
46
+ "@babel/register": "^7.22.15",
47
+ "@natlibfi/eslint-config-melinda-backend": "^3.0.3",
48
+ "@natlibfi/fixugen": "^2.0.3",
49
+ "@natlibfi/fixura": "^3.0.3",
50
+ "babel-plugin-istanbul": "^6.1.1",
51
+ "chai": "^4.3.10",
52
+ "cross-env": "^7.0.3",
53
+ "eslint": "^8.56.0",
52
54
  "mocha": "^10.2.0",
53
- "nodemon": "^3.0.1",
55
+ "nodemon": "^3.0.2",
54
56
  "nyc": "^15.1.0"
55
57
  },
56
58
  "eslintConfig": {
@@ -73,16 +75,34 @@
73
75
  }
74
76
  }
75
77
  },
78
+ "mocha": {
79
+ "spec": [
80
+ "src/*.spec.js",
81
+ "src/**/*.spec.js"
82
+ ],
83
+ "require": [
84
+ "@babel/register"
85
+ ],
86
+ "inline-diffs": true,
87
+ "maxDiffSize": 25000,
88
+ "bail": true,
89
+ "exit": true
90
+ },
91
+ "nodemonConfig": {
92
+ "exec": "npm run test:dev",
93
+ "watch": [
94
+ "src/*",
95
+ "test-fixtures/*"
96
+ ]
97
+ },
76
98
  "nyc": {
77
99
  "exclude": [
78
- "*/*.spec.js"
100
+ "src/*.spec.js",
101
+ "src/**/*.spec.js"
79
102
  ],
80
103
  "reporter": [
81
104
  "text"
82
105
  ],
83
- "require": [
84
- "@babel/register"
85
- ],
86
106
  "sourceMap": false,
87
107
  "instrument": false,
88
108
  "lines": 80,