virmator 4.2.13 → 4.2.15

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.
@@ -6,7 +6,7 @@ const mochaConfig = {
6
6
  checkLeaks: true,
7
7
  color: true,
8
8
  parallel: true,
9
- require: 'ts-node/register',
9
+ require: ['ts-node/register'],
10
10
  slow: 1_500, // ms
11
11
  timeout: 60_000, // 1 minute in ms
12
12
  reporter: SpecReporterWithFileNames.pathToThisReporter,
@@ -11,6 +11,7 @@ function getBaseConfigWithCoveragePercent(percent) {
11
11
  exclude: [
12
12
  '**/*.test.ts',
13
13
  'src/readme-examples',
14
+ '**/*.type.test.ts',
14
15
  ],
15
16
  functions: percent,
16
17
  include: 'src/*',
@@ -1,5 +1,13 @@
1
- const isTestingOtherFiles = process.argv.some((arg) => arg.match(/\.tsx?$/));
1
+ const allChildTestFilesGlob = '**/!(*.type).test.ts?(x)';
2
2
 
3
- const allTestFiles = 'src/**/!(*.type).test.ts?(x)';
3
+ const configFileIndex = process.argv.findIndex((arg) => arg.match(/\.config\.[cm]?[tj]s$/));
4
+ const possibleTestFilesOrDirs = process.argv
5
+ .slice(configFileIndex + 1)
6
+ .filter((arg) => !arg.startsWith('-'));
7
+ const specificTests = possibleTestFilesOrDirs.map((arg) =>
8
+ arg.endsWith('.ts') ? arg : `${arg}/${allChildTestFilesGlob}`,
9
+ );
4
10
 
5
- module.exports = isTestingOtherFiles ? {} : {spec: allTestFiles};
11
+ module.exports = specificTests.length
12
+ ? {spec: specificTests}
13
+ : {spec: [`src/${allChildTestFilesGlob}`]};
@@ -13,9 +13,7 @@ const webTestRunnerConfig = {
13
13
  browserStartTimeout: 120_000,
14
14
  concurrentBrowsers: 3,
15
15
  coverage: true,
16
- files: [
17
- testFiles.spec,
18
- ],
16
+ files: testFiles.spec,
19
17
  nodeResolve: true,
20
18
  plugins: [esbuildPlugin({ts: true})],
21
19
  testFramework: {
@@ -9,6 +9,7 @@
9
9
  /cspell.config.js
10
10
  /graphics/
11
11
  /Icon?
12
+ /public/
12
13
  /src/
13
14
  bash-scripts/
14
15
  test-files/
@@ -6,6 +6,7 @@
6
6
  },
7
7
  "exclude": [
8
8
  "./configs",
9
+ "./coverage",
9
10
  "./dist",
10
11
  "./node_modules",
11
12
  "./test-files"
@@ -4,7 +4,7 @@ exports.defineCommand = void 0;
4
4
  const augment_vir_1 = require("augment-vir");
5
5
  function defineCommand(defineCommandInputs, createDescription, inputExecutor) {
6
6
  const allAvailableSubCommands = (0, augment_vir_1.getObjectTypedKeys)(defineCommandInputs.subCommandDescriptions);
7
- const subCommands = (0, augment_vir_1.mapObject)(defineCommandInputs.subCommandDescriptions, (key) => key);
7
+ const subCommands = (0, augment_vir_1.mapObjectValues)(defineCommandInputs.subCommandDescriptions, (key) => key);
8
8
  const init = {
9
9
  ...defineCommandInputs,
10
10
  allAvailableSubCommands,
@@ -1 +1 @@
1
- export declare function getFirstPartOfRelativePath(from: string, to: string): string;
1
+ export declare function getFirstPartOfPath(inputPath: string): string;
@@ -1,14 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFirstPartOfRelativePath = void 0;
3
+ exports.getFirstPartOfPath = void 0;
4
4
  const path_1 = require("path");
5
- function getFirstPartOfRelativePath(from, to) {
6
- const relativePath = (0, path_1.relative)(from, to);
7
- const split = relativePath.split(path_1.sep);
5
+ function getFirstPartOfPath(inputPath) {
6
+ const split = inputPath.split(path_1.sep);
8
7
  const firstPart = split[0];
9
8
  if (!firstPart) {
10
- throw new Error(`First pat of path was empty from: "${from}" to "${to}"`);
9
+ throw new Error(`First path of path was empty from "${inputPath}"`);
11
10
  }
12
11
  return firstPart;
13
12
  }
14
- exports.getFirstPartOfRelativePath = getFirstPartOfRelativePath;
13
+ exports.getFirstPartOfPath = getFirstPartOfPath;
@@ -0,0 +1,16 @@
1
+ const baseOptions = require('./base-configs/base-mocharc.js');
2
+ const SpecReporterWithFileNames = require('mocha-spec-reporter-with-file-names');
3
+
4
+ const oneMinuteMs = 60_000;
5
+
6
+ /** @type {import('mocha').MochaOptions} */
7
+ const mochaConfig = {
8
+ ...baseOptions,
9
+ slow: 30_000, // ms
10
+ timeout: 20 * oneMinuteMs,
11
+ // heavy modification of files requires parallel to be off
12
+ parallel: false,
13
+ reporter: SpecReporterWithFileNames.pathToThisReporter,
14
+ };
15
+
16
+ module.exports = mochaConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virmator",
3
- "version": "4.2.13",
3
+ "version": "4.2.15",
4
4
  "description": "Handle all the stuffs in one package.",
5
5
  "keywords": [
6
6
  "automation",
@@ -42,7 +42,7 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "ansi-colors": "^4.1.3",
45
- "augment-vir": "^3.0.3",
45
+ "augment-vir": "^3.1.0",
46
46
  "semver": "^7.3.8",
47
47
  "simple-git": "^3.14.1"
48
48
  },
@@ -52,16 +52,16 @@
52
52
  "@types/chai": "^4.3.3",
53
53
  "@types/fs-extra": "^9.0.13",
54
54
  "@types/mocha": "^10.0.0",
55
- "@types/node": "^18.11.7",
55
+ "@types/node": "^18.11.9",
56
56
  "@types/semver": "^7.3.13",
57
57
  "@web/dev-server-esbuild": "^0.3.3",
58
58
  "@web/test-runner": "^0.15.0",
59
59
  "@web/test-runner-commands": "^0.6.5",
60
60
  "@web/test-runner-playwright": "^0.9.0",
61
61
  "ansi-colors": "^4.1.3",
62
- "augment-vir": "^3.0.3",
62
+ "augment-vir": "^3.1.0",
63
63
  "chai": "^4.3.6",
64
- "cspell": "^6.12.0",
64
+ "cspell": "^6.14.0",
65
65
  "fs-extra": "^10.1.0",
66
66
  "istanbul-smart-text-reporter": "^0.0.1",
67
67
  "markdown-code-example-inserter": "^0.1.11",
@@ -78,7 +78,7 @@
78
78
  "ts-node": "^10.9.1",
79
79
  "tsconfig-paths": "^4.1.0",
80
80
  "typescript": "^4.8.4",
81
- "vite": "^3.2.0"
81
+ "vite": "^3.2.2"
82
82
  },
83
83
  "engines": {
84
84
  "node": ">=16",