Compare commits
20 Commits
Author | SHA1 | Date | |
---|---|---|---|
4c2812f671 | |||
bab93448e8 | |||
3db913eb59 | |||
28e0c32944 | |||
0be6b3400a | |||
eeba113e09 | |||
19e45b305c | |||
f9f4150cff | |||
710548911e | |||
23f9a28fa0 | |||
e1d2f1fd68 | |||
3116c5a818 | |||
568772734b | |||
30525e7e55 | |||
f7483ef995 | |||
1460f97c52 | |||
dfac554303 | |||
1d751bdcdf | |||
bd6713eee8 | |||
440b41611b |
4
cli.child.ts
Normal file
4
cli.child.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
process.env.CLI_CALL = 'true';
|
||||||
|
import * as cliTool from './ts/index.js';
|
||||||
|
cliTool.runCli();
|
2
cli.js
2
cli.js
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
process.env.CLI_CALL = 'true';
|
process.env.CLI_CALL = 'true';
|
||||||
const cliTool = require('./dist_ts/index');
|
const cliTool = await import('./dist_ts/index.js');
|
||||||
cliTool.runCli();
|
cliTool.runCli();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
process.env.CLI_CALL = 'true';
|
process.env.CLI_CALL = 'true';
|
||||||
require('@gitzone/tsrun');
|
|
||||||
const cliTool = require('./ts/index');
|
import * as tsrun from '@gitzone/tsrun';
|
||||||
cliTool.runCli();
|
tsrun.runPath('./cli.child.js', import.meta.url);
|
||||||
|
22349
package-lock.json
generated
22349
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
25
package.json
25
package.json
@ -1,10 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tstest",
|
"name": "@gitzone/tstest",
|
||||||
"version": "1.0.63",
|
"version": "1.0.73",
|
||||||
"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",
|
||||||
"typings": "dist_ts/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
|
"type": "module",
|
||||||
"author": "Lossless GmbH",
|
"author": "Lossless GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bin": {
|
"bin": {
|
||||||
@ -15,27 +16,27 @@
|
|||||||
"prepareTest": "git clone https://gitlab.com/sandboxzone/sandbox-npmts.git .nogit/sandbox-npmts && cd .nogit/sandbox-npmts && npm install",
|
"prepareTest": "git clone https://gitlab.com/sandboxzone/sandbox-npmts.git .nogit/sandbox-npmts && cd .nogit/sandbox-npmts && npm install",
|
||||||
"tstest": "cd .nogit/sandbox-npmts && node ../../cli.ts.js test/ --web",
|
"tstest": "cd .nogit/sandbox-npmts && node ../../cli.ts.js test/ --web",
|
||||||
"cleanUp": "rm -rf .nogit/sandbox-npmts",
|
"cleanUp": "rm -rf .nogit/sandbox-npmts",
|
||||||
"build": "(tsbuild --web)"
|
"build": "(tsbuild --web --allowimplicitany)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.29",
|
"@gitzone/tsbuild": "^2.1.65",
|
||||||
"tslint": "^6.1.3",
|
"tslint": "^6.1.3",
|
||||||
"tslint-config-prettier": "^1.18.0"
|
"tslint-config-prettier": "^1.18.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@gitzone/tsbundle": "^1.0.89",
|
"@gitzone/tsbundle": "^2.0.6",
|
||||||
"@gitzone/tsrun": "^1.2.18",
|
"@gitzone/tsrun": "^1.2.37",
|
||||||
"@pushrocks/consolecolor": "^2.0.1",
|
"@pushrocks/consolecolor": "^2.0.1",
|
||||||
"@pushrocks/smartbrowser": "^1.0.22",
|
"@pushrocks/smartbrowser": "^2.0.2",
|
||||||
"@pushrocks/smartdelay": "^2.0.13",
|
"@pushrocks/smartdelay": "^2.0.13",
|
||||||
"@pushrocks/smartexpress": "^3.0.108",
|
"@pushrocks/smartexpress": "^4.0.21",
|
||||||
"@pushrocks/smartfile": "^9.0.5",
|
"@pushrocks/smartfile": "^10.0.4",
|
||||||
"@pushrocks/smartlog": "^2.0.44",
|
"@pushrocks/smartlog": "^3.0.1",
|
||||||
"@pushrocks/smartpromise": "^3.1.6",
|
"@pushrocks/smartpromise": "^3.1.7",
|
||||||
"@pushrocks/smartshell": "^2.0.30",
|
"@pushrocks/smartshell": "^2.0.30",
|
||||||
"@pushrocks/tapbundle": "^4.0.3",
|
"@pushrocks/tapbundle": "^5.0.4",
|
||||||
"@types/figures": "^3.0.1",
|
"@types/figures": "^3.0.1",
|
||||||
"figures": "^3.0.0"
|
"figures": "^4.0.1"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { expect, tap } from '@pushrocks/tapbundle';
|
import { expect, tap } from '@pushrocks/tapbundle';
|
||||||
import * as tstest from '../ts/index';
|
import * as tstest from '../ts/index.js';
|
||||||
|
|
||||||
tap.test('prepare test', async () => {});
|
tap.test('prepare test', async () => {});
|
||||||
|
|
||||||
|
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* autocreated commitinfo by @pushrocks/commitinfo
|
||||||
|
*/
|
||||||
|
export const commitinfo = {
|
||||||
|
name: '@gitzone/tstest',
|
||||||
|
version: '1.0.73',
|
||||||
|
description: 'a test utility to run tests that match test/**/*.ts'
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
import { TsTest } from './tstest.classes.tstest';
|
import { TsTest } from './tstest.classes.tstest.js';
|
||||||
|
|
||||||
export const runCli = async () => {
|
export const runCli = async () => {
|
||||||
if (!process.argv[2]) {
|
if (!process.argv[2]) {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
// ============
|
// ============
|
||||||
// combines different tap test files to an overall result
|
// combines different tap test files to an overall result
|
||||||
// ============
|
// ============
|
||||||
import * as plugins from './tstest.plugins';
|
import * as plugins from './tstest.plugins.js';
|
||||||
import { coloredString as cs } from '@pushrocks/consolecolor';
|
import { coloredString as cs } from '@pushrocks/consolecolor';
|
||||||
|
|
||||||
import { TapParser } from './tstest.classes.tap.parser';
|
import { TapParser } from './tstest.classes.tap.parser.js';
|
||||||
import * as logPrefixes from './tstest.logprefixes';
|
import * as logPrefixes from './tstest.logprefixes.js';
|
||||||
|
|
||||||
export class TapCombinator {
|
export class TapCombinator {
|
||||||
tapParserStore: TapParser[] = [];
|
tapParserStore: TapParser[] = [];
|
||||||
|
@ -4,9 +4,9 @@ import { coloredString as cs } from '@pushrocks/consolecolor';
|
|||||||
// ============
|
// ============
|
||||||
// combines different tap test files to an overall result
|
// combines different tap test files to an overall result
|
||||||
// ============
|
// ============
|
||||||
import * as plugins from './tstest.plugins';
|
import * as plugins from './tstest.plugins.js';
|
||||||
import { TapTestResult } from './tstest.classes.tap.testresult';
|
import { TapTestResult } from './tstest.classes.tap.testresult.js';
|
||||||
import * as logPrefixes from './tstest.logprefixes';
|
import * as logPrefixes from './tstest.logprefixes.js';
|
||||||
|
|
||||||
export class TapParser {
|
export class TapParser {
|
||||||
testStore: TapTestResult[] = [];
|
testStore: TapTestResult[] = [];
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// ============
|
// ============
|
||||||
// combines different tap test files to an overall result
|
// combines different tap test files to an overall result
|
||||||
// ============
|
// ============
|
||||||
import * as plugins from './tstest.plugins';
|
import * as plugins from './tstest.plugins.js';
|
||||||
|
|
||||||
export class TapTestResult {
|
export class TapTestResult {
|
||||||
testLogBuffer = Buffer.from('');
|
testLogBuffer = Buffer.from('');
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import * as plugins from './tstest.plugins';
|
import * as plugins from './tstest.plugins.js';
|
||||||
import * as paths from './tstest.paths';
|
import * as paths from './tstest.paths.js';
|
||||||
import { Smartfile } from '@pushrocks/smartfile';
|
import { Smartfile } from '@pushrocks/smartfile';
|
||||||
|
|
||||||
// tap related stuff
|
// tap related stuff
|
||||||
import { TapCombinator } from './tstest.classes.tap.combinator';
|
import { TapCombinator } from './tstest.classes.tap.combinator.js';
|
||||||
import { TapParser } from './tstest.classes.tap.parser';
|
import { TapParser } from './tstest.classes.tap.parser.js';
|
||||||
import { TapTestResult } from './tstest.classes.tap.testresult';
|
import { TapTestResult } from './tstest.classes.tap.testresult.js';
|
||||||
|
|
||||||
export class TestDirectory {
|
export class TestDirectory {
|
||||||
/**
|
/**
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import * as plugins from './tstest.plugins';
|
import * as plugins from './tstest.plugins.js';
|
||||||
import * as paths from './tstest.paths';
|
import * as paths from './tstest.paths.js';
|
||||||
import * as logPrefixes from './tstest.logprefixes';
|
import * as logPrefixes from './tstest.logprefixes.js';
|
||||||
|
|
||||||
import { coloredString as cs } from '@pushrocks/consolecolor';
|
import { coloredString as cs } from '@pushrocks/consolecolor';
|
||||||
|
|
||||||
import { TestDirectory } from './tstest.classes.testdirectory';
|
import { TestDirectory } from './tstest.classes.testdirectory.js';
|
||||||
import { TapCombinator } from './tstest.classes.tap.combinator';
|
import { TapCombinator } from './tstest.classes.tap.combinator.js';
|
||||||
import { TapParser } from './tstest.classes.tap.parser';
|
import { TapParser } from './tstest.classes.tap.parser.js';
|
||||||
|
|
||||||
export class TsTest {
|
export class TsTest {
|
||||||
public testDir: TestDirectory;
|
public testDir: TestDirectory;
|
||||||
@ -41,15 +41,15 @@ export class TsTest {
|
|||||||
case process.env.CI && fileNameArg.includes('.nonci.'):
|
case process.env.CI && fileNameArg.includes('.nonci.'):
|
||||||
console.log('!!!!!!!!!!!');
|
console.log('!!!!!!!!!!!');
|
||||||
console.log(
|
console.log(
|
||||||
`not running testfile ${fileNameArg}, sinc we are CI and file name includes '.nonci.' tag`
|
`not running testfile ${fileNameArg}, since we are CI and file name includes '.nonci.' tag`
|
||||||
);
|
);
|
||||||
console.log('!!!!!!!!!!!');
|
console.log('!!!!!!!!!!!');
|
||||||
break;
|
break;
|
||||||
case fileNameArg.endsWith('.browser.ts'):
|
case (fileNameArg.endsWith('.browser.ts') || fileNameArg.endsWith('.browser.nonci.ts' )):
|
||||||
const tapParserBrowser = await this.runInChrome(fileNameArg);
|
const tapParserBrowser = await this.runInChrome(fileNameArg);
|
||||||
tapCombinator.addTapParser(tapParserBrowser);
|
tapCombinator.addTapParser(tapParserBrowser);
|
||||||
break;
|
break;
|
||||||
case fileNameArg.endsWith('.both.ts'):
|
case (fileNameArg.endsWith('.both.ts') || fileNameArg.endsWith('.both.nonci.ts')):
|
||||||
console.log('>>>>>>> TEST PART 1: chrome');
|
console.log('>>>>>>> TEST PART 1: chrome');
|
||||||
const tapParserBothBrowser = await this.runInChrome(fileNameArg);
|
const tapParserBothBrowser = await this.runInChrome(fileNameArg);
|
||||||
tapCombinator.addTapParser(tapParserBothBrowser);
|
tapCombinator.addTapParser(tapParserBothBrowser);
|
||||||
@ -99,8 +99,10 @@ export class TsTest {
|
|||||||
const bundleFilePath = plugins.path.join(tsbundleCacheDirPath, bundleFileName);
|
const bundleFilePath = plugins.path.join(tsbundleCacheDirPath, bundleFileName);
|
||||||
|
|
||||||
// lets bundle the test
|
// lets bundle the test
|
||||||
await plugins.smartfile.fs.ensureDir(tsbundleCacheDirPath);
|
await plugins.smartfile.fs.ensureEmptyDir(tsbundleCacheDirPath);
|
||||||
await this.tsbundleInstance.buildTest(process.cwd(), fileNameArg, bundleFilePath, 'parcel');
|
await this.tsbundleInstance.build(process.cwd(), fileNameArg, bundleFilePath, {
|
||||||
|
bundler: 'esbuild'
|
||||||
|
});
|
||||||
|
|
||||||
// lets create a server
|
// lets create a server
|
||||||
const server = new plugins.smartexpress.Server({
|
const server = new plugins.smartexpress.Server({
|
||||||
@ -134,7 +136,7 @@ export class TsTest {
|
|||||||
async () => {
|
async () => {
|
||||||
const convertToText = (obj: any): string => {
|
const convertToText = (obj: any): string => {
|
||||||
// create an array that will later be joined into a string.
|
// create an array that will later be joined into a string.
|
||||||
const stringArray = [];
|
const stringArray: string[] = [];
|
||||||
|
|
||||||
if (typeof obj === 'object' && typeof obj.toString === 'function') {
|
if (typeof obj === 'object' && typeof obj.toString === 'function') {
|
||||||
stringArray.push(obj.toString());
|
stringArray.push(obj.toString());
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import * as plugins from './tstest.plugins';
|
import * as plugins from './tstest.plugins.js';
|
||||||
import { coloredString as cs } from '@pushrocks/consolecolor';
|
import { coloredString as cs } from '@pushrocks/consolecolor';
|
||||||
|
|
||||||
export const TapPrefix = cs(`::TAP::`, 'pink', 'black');
|
export const TapPrefix = cs(`::TAP::`, 'pink', 'black');
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as plugins from './tstest.plugins';
|
import * as plugins from './tstest.plugins.js';
|
||||||
|
|
||||||
export const cwd = process.cwd();
|
export const cwd = process.cwd();
|
||||||
export const testDir = plugins.path.join(cwd, './test/');
|
export const testDir = plugins.path.join(cwd, './test/');
|
||||||
export const binDirectory = plugins.path.join(cwd, 'node_modules/.bin');
|
export const binDirectory = plugins.path.join(cwd, './node_modules/.bin');
|
||||||
|
@ -32,6 +32,6 @@ import * as tsbundle from '@gitzone/tsbundle';
|
|||||||
export { tsbundle };
|
export { tsbundle };
|
||||||
|
|
||||||
// sindresorhus
|
// sindresorhus
|
||||||
import * as figures from 'figures';
|
import figures from 'figures';
|
||||||
|
|
||||||
export { figures };
|
export { figures };
|
||||||
|
Reference in New Issue
Block a user