Compare commits

...

26 Commits

Author SHA1 Message Date
ca51c9e15b 1.0.54 2021-04-29 15:48:45 +00:00
4c4f08152b fix(core): update 2021-04-29 15:48:45 +00:00
39bd80106a 1.0.53 2021-04-29 15:33:54 +00:00
d6b94b534b fix(core): update 2021-04-29 15:33:53 +00:00
d19d3fc51e 1.0.52 2020-10-01 14:29:01 +00:00
f7f1bf25f6 fix(core): update 2020-10-01 14:29:01 +00:00
42fd414609 1.0.51 2020-10-01 14:22:07 +00:00
8f16f46c37 fix(core): update 2020-10-01 14:22:06 +00:00
f8afb2c7f6 1.0.50 2020-10-01 14:12:14 +00:00
a3d1fbb2da fix(core): update 2020-10-01 14:12:13 +00:00
0da1a1bc5b 1.0.49 2020-10-01 13:30:30 +00:00
1ede0b476a fix(core): update 2020-10-01 13:30:29 +00:00
1d251689bb 1.0.48 2020-09-29 16:15:52 +00:00
8f1492dfbd fix(core): update 2020-09-29 16:15:51 +00:00
003dc473ea 1.0.47 2020-09-29 15:58:28 +00:00
e6baed5470 fix(core): update 2020-09-29 15:58:26 +00:00
d9a27adb4a 1.0.46 2020-09-29 15:29:46 +00:00
eabb75a9a8 fix(core): update 2020-09-29 15:29:45 +00:00
deb63c1af5 1.0.45 2020-09-29 15:14:33 +00:00
7ee3969798 fix(core): update 2020-09-29 15:14:32 +00:00
61eea77805 1.0.44 2020-08-13 01:29:19 +00:00
3d9685ac6f fix(core): update 2020-08-13 01:29:19 +00:00
4ec56c3f0b 1.0.43 2020-07-12 00:47:42 +00:00
ab33720aba fix(core): update 2020-07-12 00:47:41 +00:00
5e42565567 1.0.42 2020-07-11 16:14:08 +00:00
88b7581eeb fix(core): update 2020-07-11 16:14:07 +00:00
9 changed files with 2938 additions and 2271 deletions

View File

@ -19,23 +19,35 @@ mirror:
stage: security stage: security
script: script:
- npmci git mirror - npmci git mirror
only:
- tags
tags: tags:
- lossless - lossless
- docker - docker
- notpriv - notpriv
audit: auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
# - npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security stage: security
script: script:
- npmci npm prepare - npmci npm prepare
- npmci command npm install --ignore-scripts - npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org - npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high - npmci command npm audit --audit-level=high --only=dev
tags: tags:
- lossless
- docker - docker
- notpriv allow_failure: true
# ==================== # ====================
# test stage # test stage
@ -50,9 +62,7 @@ testStable:
- npmci npm test - npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- lossless
- docker - docker
- priv
testBuild: testBuild:
stage: test stage: test
@ -63,9 +73,7 @@ testBuild:
- npmci command npm run build - npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- lossless
- docker - docker
- notpriv
release: release:
stage: release stage: release
@ -85,6 +93,8 @@ release:
codequality: codequality:
stage: metadata stage: metadata
allow_failure: true allow_failure: true
only:
- tags
script: script:
- npmci command npm install -g tslint typescript - npmci command npm install -g tslint typescript
- npmci npm prepare - npmci npm prepare

View File

@ -15,7 +15,7 @@
"properties": { "properties": {
"projectType": { "projectType": {
"type": "string", "type": "string",
"enum": ["website", "element", "service", "npm"] "enum": ["website", "element", "service", "npm", "wcc"]
} }
} }
} }

5072
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "@gitzone/tstest", "name": "@gitzone/tstest",
"version": "1.0.41", "version": "1.0.54",
"private": false, "private": false,
"description": "a test utility to run tests that match test/**/*.ts", "description": "a test utility to run tests that match test/**/*.ts",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
@ -18,22 +18,22 @@
"build": "(tsbuild --web)" "build": "(tsbuild --web)"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.17", "@gitzone/tsbuild": "^2.1.25",
"@pushrocks/tapbundle": "^3.2.7", "tslint": "^6.1.3",
"tslint": "^6.1.2",
"tslint-config-prettier": "^1.18.0" "tslint-config-prettier": "^1.18.0"
}, },
"dependencies": { "dependencies": {
"@gitzone/tsbundle": "^1.0.72", "@gitzone/tsbundle": "^1.0.80",
"@gitzone/tsrun": "^1.2.12", "@gitzone/tsrun": "^1.2.12",
"@pushrocks/consolecolor": "^2.0.1", "@pushrocks/consolecolor": "^2.0.1",
"@pushrocks/smartbrowser": "^1.0.17", "@pushrocks/smartbrowser": "^1.0.17",
"@pushrocks/smartdelay": "^2.0.9", "@pushrocks/smartdelay": "^2.0.10",
"@pushrocks/smartexpress": "^3.0.73", "@pushrocks/smartexpress": "^3.0.100",
"@pushrocks/smartfile": "^7.0.6", "@pushrocks/smartfile": "^8.0.10",
"@pushrocks/smartlog": "^2.0.19", "@pushrocks/smartlog": "^2.0.39",
"@pushrocks/smartpromise": "^3.0.6", "@pushrocks/smartpromise": "^3.1.5",
"@pushrocks/smartshell": "^2.0.25", "@pushrocks/smartshell": "^2.0.25",
"@pushrocks/tapbundle": "^3.2.14",
"@types/figures": "^3.0.1", "@types/figures": "^3.0.1",
"figures": "^3.0.0" "figures": "^3.0.0"
}, },
@ -48,5 +48,8 @@
"cli.js", "cli.js",
"npmextra.json", "npmextra.json",
"readme.md" "readme.md"
],
"browserslist": [
"last 1 chrome versions"
] ]
} }

View File

@ -19,12 +19,15 @@ TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud) Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@gitzone/tstest)](https://lossless.cloud) PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@gitzone/tstest)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@gitzone/tstest)](https://lossless.cloud) PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@gitzone/tstest)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@gitzone/tstest)](https://lossless.cloud) BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@gitzone/tstest)](https://lossless.cloud)
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud) Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)
## Usage ## Usage
## Contribution
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
## Contribution ## Contribution

View File

@ -28,6 +28,15 @@ export class TapCombinator {
` ${plugins.figures.pointer} ` + ` ${plugins.figures.pointer} ` +
`does not specify tests!`; `does not specify tests!`;
console.log(overviewString); console.log(overviewString);
} else if (tapParser.expectedTests !== tapParser.receivedTests) {
failGlobal = true;
let overviewString =
logPrefixes.TsTestPrefix +
cs(` ${tapParser.fileName} ${plugins.figures.cross}`, 'red') +
` ${plugins.figures.pointer} ` +
tapParser.getTestOverviewAsString() +
`did not execute all specified tests!`;
console.log(overviewString);
} else if (tapParser.getErrorTests().length === 0) { } else if (tapParser.getErrorTests().length === 0) {
let overviewString = let overviewString =
logPrefixes.TsTestPrefix + logPrefixes.TsTestPrefix +

View File

@ -182,7 +182,12 @@ export class TapParser {
if (!this.expectedTests) { if (!this.expectedTests) {
console.log(cs('Error: No tests were defined. Therefore the testfile failed!', 'red')); console.log(cs('Error: No tests were defined. Therefore the testfile failed!', 'red'));
} else if (this.expectedTests !== this.receivedTests) { } else if (this.expectedTests !== this.receivedTests) {
console.log(cs('Error: The amount of received tests and expectedTests is unequal! Therefore the testfile failed', 'red')); console.log(
cs(
'Error: The amount of received tests and expectedTests is unequal! Therefore the testfile failed',
'red'
)
);
} else if (this.getErrorTests().length === 0) { } else if (this.getErrorTests().length === 0) {
console.log(`${logPrefixes.TapPrefix} ${cs(`All tests are successfull!!!`, 'green')}`); console.log(`${logPrefixes.TapPrefix} ${cs(`All tests are successfull!!!`, 'green')}`);
} else { } else {

View File

@ -37,16 +37,34 @@ export class TsTest {
const tapCombinator = new TapCombinator(); // lets create the TapCombinator const tapCombinator = new TapCombinator(); // lets create the TapCombinator
for (const fileNameArg of fileNamesToRun) { for (const fileNameArg of fileNamesToRun) {
let tapParser: TapParser;
switch (true) { switch (true) {
case process.env.CI && fileNameArg.includes('.nonci.'):
console.log('!!!!!!!!!!!');
console.log(
`not running testfile ${fileNameArg}, sinc we are CI and file name includes '.nonci.' tag`
);
console.log('!!!!!!!!!!!');
break;
case fileNameArg.endsWith('.browser.ts'): case fileNameArg.endsWith('.browser.ts'):
tapParser = await this.runInChrome(fileNameArg); const tapParserBrowser = await this.runInChrome(fileNameArg);
tapCombinator.addTapParser(tapParserBrowser);
break;
case fileNameArg.endsWith('.both.ts'):
console.log('>>>>>>> TEST PART 1: chrome');
const tapParserBothBrowser = await this.runInChrome(fileNameArg);
tapCombinator.addTapParser(tapParserBothBrowser);
console.log(cs(`|`.repeat(16), 'cyan'));
console.log(''); // force new line
console.log('>>>>>>> TEST PART 2: node');
const tapParserBothNode = await this.runInNode(fileNameArg);
tapCombinator.addTapParser(tapParserBothNode);
break; break;
default: default:
tapParser = await this.runInNode(fileNameArg); const tapParserNode = await this.runInNode(fileNameArg);
tapCombinator.addTapParser(tapParserNode);
break; break;
} }
tapCombinator.addTapParser(tapParser);
console.log(cs(`^`.repeat(16), 'cyan')); console.log(cs(`^`.repeat(16), 'cyan'));
console.log(''); // force new line console.log(''); // force new line
} }
@ -56,7 +74,7 @@ export class TsTest {
public async runInNode(fileNameArg: string): Promise<TapParser> { public async runInNode(fileNameArg: string): Promise<TapParser> {
console.log(`${cs('=> ', 'blue')} Running ${cs(fileNameArg, 'orange')} in node.js runtime.`); console.log(`${cs('=> ', 'blue')} Running ${cs(fileNameArg, 'orange')} in node.js runtime.`);
console.log(`${cs(`= `.repeat(32), 'cyan')}`); console.log(`${cs(`= `.repeat(32), 'cyan')}`);
const tapParser = new TapParser(fileNameArg); const tapParser = new TapParser(fileNameArg + ':node');
// tsrun options // tsrun options
let tsrunOptions = ''; let tsrunOptions = '';
@ -168,7 +186,9 @@ export class TsTest {
const bundleName = new URLSearchParams(window.location.search).get('bundleName'); const bundleName = new URLSearchParams(window.location.search).get('bundleName');
console.log(`::TSTEST IN CHROMIUM:: Relevant Script name is: ${bundleName}`); console.log(`::TSTEST IN CHROMIUM:: Relevant Script name is: ${bundleName}`);
const bundleResponse = await fetch(`/${bundleName}`); const bundleResponse = await fetch(`/${bundleName}`);
console.log(`::TSTEST IN CHROMIUM:: Got ${bundleName} with STATUS ${bundleResponse.status}`); console.log(
`::TSTEST IN CHROMIUM:: Got ${bundleName} with STATUS ${bundleResponse.status}`
);
const bundle = await bundleResponse.text(); const bundle = await bundleResponse.text();
console.log(`::TSTEST IN CHROMIUM:: Executing ${bundleName}`); console.log(`::TSTEST IN CHROMIUM:: Executing ${bundleName}`);
try { try {
@ -188,10 +208,12 @@ export class TsTest {
); );
await this.smartbrowserInstance.stop(); await this.smartbrowserInstance.stop();
await server.stop(); await server.stop();
console.log(`${cs('=> ', 'blue')} Stopped ${cs(fileNameArg, 'orange')} chromium instance and server.`); console.log(
`${cs('=> ', 'blue')} Stopped ${cs(fileNameArg, 'orange')} chromium instance and server.`
);
console.log(`${cs('=> ', 'blue')} See the result captured from the chromium execution:`); console.log(`${cs('=> ', 'blue')} See the result captured from the chromium execution:`);
// lets create the tap parser // lets create the tap parser
const tapParser = new TapParser(fileNameArg); const tapParser = new TapParser(fileNameArg + ':chrome');
tapParser.handleTapLog(evaluation); tapParser.handleTapLog(evaluation);
return tapParser; return tapParser;
} }

View File

@ -12,15 +12,24 @@ import * as smartfile from '@pushrocks/smartfile';
import * as smartlog from '@pushrocks/smartlog'; import * as smartlog from '@pushrocks/smartlog';
import * as smartpromise from '@pushrocks/smartpromise'; import * as smartpromise from '@pushrocks/smartpromise';
import * as smartshell from '@pushrocks/smartshell'; import * as smartshell from '@pushrocks/smartshell';
import * as tapbundle from '@pushrocks/tapbundle';
export { consolecolor, smartbrowser, smartexpress, smartdelay, smartfile, smartlog, smartpromise, smartshell }; export {
consolecolor,
smartbrowser,
smartexpress,
smartdelay,
smartfile,
smartlog,
smartpromise,
smartshell,
tapbundle,
};
// @gitzone scope // @gitzone scope
import * as tsbundle from '@gitzone/tsbundle'; import * as tsbundle from '@gitzone/tsbundle';
export { export { tsbundle };
tsbundle
};
// sindresorhus // sindresorhus
import * as figures from 'figures'; import * as figures from 'figures';