@genesislcap/uvu-playwright-builder 15.19.0 → 15.19.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/uvu-playwright-builder",
3
3
  "description": "UVU/Playwright builder",
4
- "version": "15.19.0",
4
+ "version": "15.19.1",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -16,8 +16,8 @@
16
16
  "lint:fix": "genx lint -l ox --fix"
17
17
  },
18
18
  "dependencies": {
19
- "@genesislcap/build-kit": "15.19.0",
20
- "@genesislcap/foundation-testing": "15.19.0",
19
+ "@genesislcap/build-kit": "15.19.1",
20
+ "@genesislcap/foundation-testing": "15.19.1",
21
21
  "c8": "^7.11.0",
22
22
  "nyc": "^15.1.0",
23
23
  "playwright-test": "^14.1.12",
@@ -36,6 +36,5 @@
36
36
  },
37
37
  "publishConfig": {
38
38
  "access": "public"
39
- },
40
- "gitHead": "83695de98c2288c2e89992215cb391652f6c5eec"
39
+ }
41
40
  }
package/src/index.ts DELETED
@@ -1,83 +0,0 @@
1
- import { resolve } from 'node:path';
2
- import type { BuildContext } from '@genesislcap/build-kit';
3
- import { rm, run, resolveBin } from '@genesislcap/build-kit';
4
-
5
- export default async (ctx: BuildContext) => {
6
- const {
7
- dirs: { cwd },
8
- cli: { isTest, options },
9
- pkg,
10
- } = ctx;
11
- const { coverage, watch, debug, e2e, interactive, browser, match, rawMatch } = options;
12
-
13
- if (!isTest) {
14
- throw new Error(`Unrecognized command: ${JSON.stringify(options)}`);
15
- }
16
-
17
- if (coverage) {
18
- await rm(['coverage']);
19
- }
20
-
21
- // E2E tests
22
- if (e2e) {
23
- const uiParam = interactive ? '--ui' : '';
24
- const debugParam = debug ? '--debug' : '';
25
-
26
- run(cwd, `npx playwright test --config=./playwright.config.ts ${uiParam} ${debugParam}`, {
27
- prefixCommandWithNode: false,
28
- env: {
29
- ...process.env,
30
- PORT: pkg.config?.PORT,
31
- },
32
- });
33
- return;
34
- } else {
35
- // unit tests
36
- if (browser) {
37
- // browser target - executing using playwright-test
38
- // Resolve from builder's package location since playwright-test is a dependency of uvu-playwright-builder
39
- const builderPackageDir = resolve(__dirname, '..');
40
- const playwrightTest = await resolveBin(
41
- 'playwright-test',
42
- 'playwright-test',
43
- builderPackageDir,
44
- );
45
- const debugParam = debug ? '--debug' : '';
46
- const watchParam = watch ? '--watch' : '';
47
- const covParam = coverage ? '--cov' : '';
48
- let matchParam = './**/*.test.ts';
49
- if (match) {
50
- matchParam = rawMatch ? match : `./**/${match}`;
51
- }
52
- const command = `${playwrightTest} "${matchParam}" --runner uvu ${debugParam} ${watchParam} ${covParam}`;
53
- run(cwd, command);
54
-
55
- if (coverage) {
56
- const nyc = await resolveBin('nyc');
57
- const nycCommand = `${nyc} report --reporter=text --reporter=lcov`;
58
- run(cwd, nycCommand);
59
- }
60
- } else {
61
- // node target - executing using uvu/jsdom
62
- const nodeArgs = debug ? '--inspect-brk' : '';
63
- const matchParam = match ? match : 'test.ts';
64
- const jsdomSetupPath = resolve(__dirname, './config/jsdom.setup.ts');
65
- const uvu = await resolveBin('uvu');
66
- const ignore = ['dist', 'e2e', 'docs', 'temp', 'coverage']; // .git, node_modules are ignored by default
67
- const unitTestCommand = `${uvu} -r tsx/cjs -r ${jsdomSetupPath} . "${matchParam}" ${ignore.map(
68
- (i) => ' -i ' + i,
69
- )}`;
70
-
71
- if (coverage) {
72
- const c8 = await resolveBin('c8');
73
- const command = `${c8} --include=src --all --reporter=text --reporter=lcov node ${unitTestCommand}`;
74
- run(cwd, command);
75
- } else if (watch) {
76
- const watchlist = await resolveBin('watchlist');
77
- run(cwd, `${watchlist} src test -- ${unitTestCommand}`);
78
- } else {
79
- run(cwd, unitTestCommand, { nodeArgs });
80
- }
81
- }
82
- }
83
- };
package/tsconfig.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.json",
3
- "compilerOptions": {
4
- "declarationDir": "./dist",
5
- "lib": ["ES2015", "ES2016", "ES2017", "ES2019"],
6
- "module": "commonjs",
7
- "outDir": "./dist",
8
- "rootDir": "./src"
9
- },
10
- "include": ["src/**/*"]
11
- }
@@ -1 +0,0 @@
1
- {"root":["./src/index.ts"],"version":"5.9.2"}