node-cli-tester 18.0.19 → 18.0.21
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/assets/shared/shared_folder_info.txt +1 -1
- package/index.js +15 -2
- package/index.js.map +1 -1
- package/lib/base-project-structure.backend.js +38 -47
- package/lib/base-project-structure.backend.js.map +1 -1
- package/lib/build-info._auto-generated_.js.map +1 -1
- package/lib/cli-test.backend.js +101 -126
- package/lib/cli-test.backend.js.map +1 -1
- package/lib/index._auto-generated_.d.ts +1 -0
- package/lib/index._auto-generated_.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/meta-content-md.backend.js +167 -214
- package/lib/meta-content-md.backend.js.map +1 -1
- package/lib/node-cli-tester.js +151 -236
- package/lib/node-cli-tester.js.map +1 -1
- package/lib/spec-templates.backend.js +90 -30
- package/lib/spec-templates.backend.js.map +1 -1
- package/lib/start.backend.js +15 -10
- package/lib/start.backend.js.map +1 -1
- package/migrations/index.js +15 -2
- package/migrations/index.js.map +1 -1
- package/migrations/migrations_index._auto-generated_.d.ts +1 -0
- package/migrations/migrations_index._auto-generated_.js.map +1 -1
- package/package.json +5 -45
- package/src.d.ts +1 -1
- package/tmp-environment.json +8 -379
- package/browser/package.json +0 -25
- package/taon.jsonc +0 -39
- package/websql/package.json +0 -25
|
@@ -1,50 +1,110 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
9
|
exports.TestTemplates = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
10
|
//#region imports
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
const tnp_core_1 = require("tnp-core");
|
|
12
|
+
const typescript_class_helpers_1 = require("typescript-class-helpers");
|
|
13
|
+
const tnp_helpers_1 = require("tnp-helpers");
|
|
9
14
|
//#endregion
|
|
10
15
|
//#region base imports contant
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
const baseImports = `
|
|
17
|
+
import { _, path, crossPlatformPath } from 'tnp-core';
|
|
18
|
+
import chalk from 'chalk';
|
|
19
|
+
import { describe, before, beforeEach, it } from 'mocha';
|
|
20
|
+
import { expect } from 'chai';
|
|
21
|
+
import { CLASS } from 'typescript-class-helpers';
|
|
22
|
+
import { Helpers } from 'tnp-helpers';
|
|
23
|
+
import { config } from 'tnp-config';
|
|
24
|
+
import { NodeCliTester } from '../lib';
|
|
25
|
+
`.trim();
|
|
26
|
+
const testMeta = `
|
|
27
|
+
// const testName = this.test.title;
|
|
28
|
+
// const testFullName = this.test.fullTitle();
|
|
29
|
+
`.trim();
|
|
13
30
|
//#endregion
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
31
|
+
let TestTemplates = class TestTemplates {
|
|
32
|
+
static DEFAULT_COMMAND = `echo "hello world"`;
|
|
33
|
+
static PROJECT_ENTITY_LOCATION = `tnp-helpers`;
|
|
17
34
|
//#region create test part
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
35
|
+
static testPart(pathToFiles, projPath, timeHash) {
|
|
36
|
+
const describes = `
|
|
37
|
+
|
|
38
|
+
it('Should pass the test with hash ' + cwdHash // chalk.hidden(cwdHash)
|
|
39
|
+
, async () => {
|
|
40
|
+
//#region resolve variables
|
|
41
|
+
${'' // testMeta
|
|
42
|
+
}
|
|
43
|
+
const projFolder = '${tnp_core_1._.first(projPath.split('/'))}';
|
|
44
|
+
const tmpTestEnvironmentFolder = 'tmp-tests-environments';
|
|
45
|
+
const cwd = path.resolve(path.join(crossPlatformPath(__dirname), \`../../../../\${tmpTestEnvironmentFolder}\`, cwdHash));
|
|
46
|
+
const relativePathToFile = {
|
|
47
|
+
${pathToFiles.map(pathToFile => `${tnp_core_1._.camelCase(tnp_core_1.path.basename(pathToFile))} : \`${pathToFile.split('/').slice(1).join('/')}\``)
|
|
48
|
+
.join(',\n ')}
|
|
49
|
+
};
|
|
50
|
+
const absolutePathToTestFile = {
|
|
51
|
+
${pathToFiles.map(pathToFile => `${tnp_core_1._.camelCase(tnp_core_1.path.basename(pathToFile))} : path.join(cwd, projFolder, relativePathToFile.${tnp_core_1._.camelCase(tnp_core_1.path.basename(pathToFile))})`)
|
|
52
|
+
.join(',\n ')}
|
|
53
|
+
};
|
|
54
|
+
await NodeCliTester.InstanceNearestTo(cwd).regenerateEnvironment(cwdHash,tmpTestEnvironmentFolder);
|
|
55
|
+
const $Project = Project || CLASS.getBy('Project') as typeof Project;
|
|
56
|
+
const proj = $Project.From(path.join(cwd,projFolder));
|
|
57
|
+
//#endregion
|
|
58
|
+
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
expect(proj.runCommandGetString(\`${this.DEFAULT_COMMAND}\`)).to.be.eq('hello world');
|
|
61
|
+
});
|
|
62
|
+
`;
|
|
63
|
+
const testsImports = `
|
|
64
|
+
${'' // baseImports
|
|
65
|
+
}
|
|
66
|
+
${'' // import { Project } from '${this.PROJECT_ENTITY_LOCATION}';
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
`;
|
|
70
|
+
const result = '\n'
|
|
27
71
|
+ testsImports.trim()
|
|
28
|
-
+
|
|
72
|
+
+ `
|
|
73
|
+
describe('${projPath}',()=> {
|
|
74
|
+
const cwdHash = '${timeHash}';
|
|
75
|
+
${describes}
|
|
76
|
+
});
|
|
77
|
+
`.trim() + '\n\n';
|
|
29
78
|
return result;
|
|
30
|
-
}
|
|
79
|
+
}
|
|
31
80
|
//#endregion
|
|
32
81
|
//#region regenerate spec ts
|
|
33
|
-
|
|
82
|
+
static regenerateSpecTs(specTsPath, testRealName) {
|
|
34
83
|
if (!tnp_helpers_1.Helpers.exists(specTsPath)) {
|
|
35
84
|
tnp_helpers_1.Helpers.writeFile(specTsPath,
|
|
36
85
|
//#region content of *.spec.ts
|
|
37
|
-
|
|
86
|
+
`
|
|
87
|
+
${baseImports}
|
|
88
|
+
import { Project } from '${this.PROJECT_ENTITY_LOCATION}';
|
|
89
|
+
|
|
90
|
+
describe('${testRealName}', () => {
|
|
91
|
+
|
|
92
|
+
// PUT ALL YOUR TESTS HERE
|
|
93
|
+
|
|
94
|
+
it('should works example unit test', () => {
|
|
95
|
+
${testMeta}
|
|
96
|
+
expect(1).to.be.gt(0)
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
});
|
|
100
|
+
`.trim() + '\n'
|
|
38
101
|
//#endregion
|
|
39
102
|
);
|
|
40
103
|
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
TestTemplates.PROJECT_ENTITY_LOCATION = "tnp-helpers";
|
|
44
|
-
TestTemplates = tslib_1.__decorate([
|
|
45
|
-
typescript_class_helpers_1.CLASS.NAME('TestTemplates')
|
|
46
|
-
], TestTemplates);
|
|
47
|
-
return TestTemplates;
|
|
48
|
-
}());
|
|
104
|
+
}
|
|
105
|
+
};
|
|
49
106
|
exports.TestTemplates = TestTemplates;
|
|
107
|
+
exports.TestTemplates = TestTemplates = __decorate([
|
|
108
|
+
typescript_class_helpers_1.CLASS.NAME('TestTemplates')
|
|
109
|
+
], TestTemplates);
|
|
50
110
|
//# sourceMappingURL=spec-templates.backend.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec-templates.backend.js","sourceRoot":"","sources":[""],"names":[],"mappings":"
|
|
1
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,IAAI,CAAC,eAAe;;CAE1D,CAAC;QAGE,MAAM,YAAY,GAAG;EACvB,EAAE,CAAE,cAAc;QACd;EACJ,EAAE,CAAC,6DAA6D;QAC5D;;CAEL,CAAC;QACE,MAAM,MAAM,GAAG,IAAI;cACf,YAAY,CAAC,IAAI,EAAE;cACnB;YACI,QAAQ;qBACC,QAAQ;EAC3B,SAAS;;GAER,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC;QAChB,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,YAAY;IAEZ,4BAA4B;IACrB,MAAM,CAAC,gBAAgB,CAAC,UAAkB,EAAE,YAAoB;QACrE,IAAI,CAAC,qBAAO,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;YAChC,qBAAO,CAAC,SAAS,CAAC,UAAU;YAC1B,8BAA8B;YAC9B;EACN,WAAW;2BACc,IAAI,CAAC,uBAAuB;;YAE3C,YAAY;;;;;EAKtB,QAAQ;;;;;CAKT,CAAC,IAAI,EAAE,GAAG,IAAI;YACP,YAAY;aACb,CAAC;QACJ,CAAC;IACH,CAAC;;AA7EU,sCAAa;wBAAb,aAAa;IADzB,gCAAK,CAAC,IAAI,CAAC,eAAe,CAAC;GACf,aAAa,CAgFzB"}
|
package/lib/start.backend.js
CHANGED
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.run = run;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
const node_cli_tester_1 = require("./node-cli-tester");
|
|
5
|
+
async function run(argsv, instance = node_cli_tester_1.NodeCliTester.Instance()) {
|
|
6
|
+
// const command: Lowercase<keyof NodeCliTester> = argsv.shift().toLowerCase() as any;
|
|
7
|
+
// TODO
|
|
8
|
+
// const command = argsv.shift().toLowerCase() as any; // TODO up tsc version
|
|
9
|
+
// for (const key in instance) {
|
|
10
|
+
// if (key.toLowerCase() === command && _.isFunction(instance[key])) {
|
|
11
|
+
// const argsToPass: string[] = argsv
|
|
12
|
+
// .filter(a => !a.startsWith('--'))
|
|
13
|
+
// .map(a => parseArr(a)) as any;
|
|
14
|
+
// await Helpers.runSyncOrAsync({ functionFn: [key, instance], arrayOfParams: argsToPass });
|
|
15
|
+
// }
|
|
16
|
+
// }
|
|
17
|
+
// process.exit(0);
|
|
13
18
|
}
|
|
14
19
|
function parseArr(a) {
|
|
15
20
|
if (a === 'null') {
|
|
16
21
|
return null;
|
|
17
22
|
}
|
|
18
23
|
if (a.startsWith('[') && a.endsWith(']')) {
|
|
19
|
-
|
|
24
|
+
const elems = a.slice(1, a.length - 1).split(',');
|
|
20
25
|
return elems;
|
|
21
26
|
}
|
|
22
27
|
return a;
|
package/lib/start.backend.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.backend.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;AAIA,kBAgBC
|
|
1
|
+
{"version":3,"file":"start.backend.js","sourceRoot":"","sources":["/Users/dfilipiak/projects/npm/taon-dev/node-cli-tester/src/lib/start.backend.ts"],"names":[],"mappings":";;AAIA,kBAgBC;AAlBD,uDAAkD;AAE3C,KAAK,UAAU,GAAG,CACvB,KAAe,EAAE,WAAc,+BAAa,CAAC,QAAQ,EAAS;IAG9D,sFAAsF;IACtF,OAAO;IACP,6EAA6E;IAC7E,gCAAgC;IAChC,wEAAwE;IACxE,yCAAyC;IACzC,0CAA0C;IAC1C,uCAAuC;IACvC,gGAAgG;IAChG,MAAM;IACN,IAAI;IACJ,mBAAmB;AACrB,CAAC;AAED,SAAS,QAAQ,CAAC,CAAS;IACzB,IAAI,CAAC,KAAK,MAAM,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACzC,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
package/migrations/index.js
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var tslib_1 = require("tslib");
|
|
4
17
|
//@ts-nocheck
|
|
5
|
-
|
|
18
|
+
__exportStar(require("./migrations_index._auto-generated_"), exports);
|
|
6
19
|
//# sourceMappingURL=index.js.map
|
package/migrations/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":[""],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["/Users/dfilipiak/projects/npm/taon-dev/node-cli-tester/src/migrations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,aAAa;AACb,sEAAoD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrations_index._auto-generated_.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,yCAAyC;AAEzC,yCAAyC;AAEzC,yCAAyC"}
|
|
1
|
+
{"version":3,"file":"migrations_index._auto-generated_.js","sourceRoot":"","sources":["/Users/dfilipiak/projects/npm/taon-dev/node-cli-tester/src/migrations/migrations_index._auto-generated_.ts"],"names":[],"mappings":"AAAA,yCAAyC;AAEzC,yCAAyC;AAEzC,yCAAyC"}
|
package/package.json
CHANGED
|
@@ -1,55 +1,15 @@
|
|
|
1
1
|
{
|
|
2
|
-
"tnp": {
|
|
3
|
-
"resources": [
|
|
4
|
-
"README.md"
|
|
5
|
-
],
|
|
6
|
-
"overrided": {
|
|
7
|
-
"ignoreDepsPattern": [],
|
|
8
|
-
"includeAsDev": [],
|
|
9
|
-
"includeOnly": [
|
|
10
|
-
"tnp-helpers"
|
|
11
|
-
],
|
|
12
|
-
"dependencies": {},
|
|
13
|
-
"linkedFolders": [],
|
|
14
|
-
"npmFixes": []
|
|
15
|
-
},
|
|
16
|
-
"smartContainerBuildTarget": "",
|
|
17
|
-
"linkedRepos": [],
|
|
18
|
-
"libReleaseOptions": {
|
|
19
|
-
"nodts": false,
|
|
20
|
-
"obscure": false,
|
|
21
|
-
"ugly": false,
|
|
22
|
-
"includeNodeModules": false,
|
|
23
|
-
"cliBuildNoDts": false,
|
|
24
|
-
"cliBuildObscure": false,
|
|
25
|
-
"cliBuildIncludeNodeModules": false,
|
|
26
|
-
"cliBuildUglify": false
|
|
27
|
-
},
|
|
28
|
-
"smartContainerTarget": "",
|
|
29
|
-
"type": "isomorphic-lib",
|
|
30
|
-
"isCoreProject": false,
|
|
31
|
-
"useFramework": false,
|
|
32
|
-
"required": [],
|
|
33
|
-
"version": "v18",
|
|
34
|
-
"isGenerated": false,
|
|
35
|
-
"requiredServers": [],
|
|
36
|
-
"license": "UNLICENSED",
|
|
37
|
-
"main": "index.js",
|
|
38
|
-
"private": false,
|
|
39
|
-
"workerPlugins": {}
|
|
40
|
-
},
|
|
41
2
|
"name": "node-cli-tester",
|
|
42
|
-
"version": "18.0.
|
|
3
|
+
"version": "18.0.21",
|
|
43
4
|
"license": "UNLICENSED",
|
|
5
|
+
"author": "Dariusz Filipiak",
|
|
6
|
+
"private": false,
|
|
44
7
|
"dependencies": {
|
|
45
|
-
"tnp-helpers": "
|
|
8
|
+
"tnp-helpers": "18.0.21"
|
|
46
9
|
},
|
|
47
10
|
"bin": {
|
|
48
11
|
"node-cli-tester": "bin/node-cli-tester",
|
|
49
12
|
"node-cli-tester-debug": "bin/node-cli-tester-debug"
|
|
50
13
|
},
|
|
51
|
-
"
|
|
52
|
-
"private": false,
|
|
53
|
-
"devDependencies": {},
|
|
54
|
-
"main": "index.js"
|
|
14
|
+
"peerDependencies": {}
|
|
55
15
|
}
|
package/src.d.ts
CHANGED