@react-native-harness/cli 1.0.0-canary.1764662948126 ā 1.0.0-canary.1766225407244
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/dist/bundlers/metro.d.ts +2 -2
- package/dist/bundlers/metro.d.ts.map +1 -1
- package/dist/bundlers/metro.js +24 -47
- package/dist/platforms/android/build.d.ts +2 -3
- package/dist/platforms/android/build.d.ts.map +1 -1
- package/dist/platforms/android/build.js +49 -24
- package/dist/platforms/android/emulator.d.ts +1 -0
- package/dist/platforms/android/emulator.d.ts.map +1 -1
- package/dist/platforms/android/emulator.js +132 -101
- package/dist/platforms/android/index.d.ts.map +1 -1
- package/dist/platforms/android/index.js +19 -23
- package/dist/platforms/ios/build.d.ts +7 -5
- package/dist/platforms/ios/build.d.ts.map +1 -1
- package/dist/platforms/ios/build.js +116 -41
- package/dist/platforms/ios/index.d.ts.map +1 -1
- package/dist/platforms/ios/index.js +32 -24
- package/dist/platforms/ios/simulator.d.ts +4 -4
- package/dist/platforms/ios/simulator.d.ts.map +1 -1
- package/dist/platforms/ios/simulator.js +131 -104
- package/dist/platforms/platform-adapter.d.ts +4 -2
- package/dist/platforms/platform-adapter.d.ts.map +1 -1
- package/dist/platforms/platform-registry.d.ts.map +1 -1
- package/dist/platforms/platform-registry.js +1 -5
- package/dist/platforms/web/index.d.ts +1 -3
- package/dist/platforms/web/index.d.ts.map +1 -1
- package/dist/platforms/web/index.js +50 -9
- package/dist/process.js +1 -1
- package/dist/reporters/default-reporter.d.ts.map +1 -1
- package/dist/reporters/default-reporter.js +17 -22
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/commands/test.d.ts +0 -3
- package/dist/commands/test.d.ts.map +0 -1
- package/dist/commands/test.js +0 -140
- package/dist/discovery/index.d.ts +0 -3
- package/dist/discovery/index.d.ts.map +0 -1
- package/dist/discovery/index.js +0 -1
- package/dist/discovery/testDiscovery.d.ts +0 -11
- package/dist/discovery/testDiscovery.d.ts.map +0 -1
- package/dist/discovery/testDiscovery.js +0 -29
- package/dist/errors/appNotInstalledError.d.ts +0 -7
- package/dist/errors/appNotInstalledError.d.ts.map +0 -1
- package/dist/errors/appNotInstalledError.js +0 -12
- package/dist/errors/bridgeTimeoutError.d.ts +0 -7
- package/dist/errors/bridgeTimeoutError.d.ts.map +0 -1
- package/dist/errors/bridgeTimeoutError.js +0 -12
- package/dist/errors/errorHandler.d.ts +0 -2
- package/dist/errors/errorHandler.d.ts.map +0 -1
- package/dist/errors/errorHandler.js +0 -152
- package/dist/errors/errors.d.ts +0 -45
- package/dist/errors/errors.d.ts.map +0 -1
- package/dist/errors/errors.js +0 -89
- package/dist/jest.d.ts +0 -2
- package/dist/jest.d.ts.map +0 -1
- package/dist/jest.js +0 -7
- package/dist/platforms/android/device.d.ts +0 -5
- package/dist/platforms/android/device.d.ts.map +0 -1
- package/dist/platforms/android/device.js +0 -36
- package/dist/platforms/ios/device.d.ts +0 -11
- package/dist/platforms/ios/device.d.ts.map +0 -1
- package/dist/platforms/ios/device.js +0 -51
- package/dist/platforms/vega/build.d.ts +0 -23
- package/dist/platforms/vega/build.d.ts.map +0 -1
- package/dist/platforms/vega/build.js +0 -55
- package/dist/platforms/vega/device.d.ts +0 -57
- package/dist/platforms/vega/device.d.ts.map +0 -1
- package/dist/platforms/vega/device.js +0 -206
- package/dist/platforms/vega/index.d.ts +0 -4
- package/dist/platforms/vega/index.d.ts.map +0 -1
- package/dist/platforms/vega/index.js +0 -75
- package/dist/reporters/junit-reporter.d.ts +0 -3
- package/dist/reporters/junit-reporter.d.ts.map +0 -1
- package/dist/reporters/junit-reporter.js +0 -119
- package/dist/reporters/live-reporter.d.ts +0 -20
- package/dist/reporters/live-reporter.d.ts.map +0 -1
- package/dist/reporters/live-reporter.js +0 -176
- package/dist/src/reporters/default-reporter.js +0 -135
- package/dist/test-reporter-demo.js +0 -95
- package/dist/utils/status-formatter.d.ts +0 -27
- package/dist/utils/status-formatter.d.ts.map +0 -1
- package/dist/utils/status-formatter.js +0 -54
- package/dist/utils.d.ts +0 -6
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -26
|
@@ -1,9 +1,50 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
// import path from 'path';
|
|
2
|
+
// import { runWebpack } from '../../bundlers/webpack.js';
|
|
3
|
+
// import { PlatformAdapter } from '../platform-adapter.js';
|
|
4
|
+
// import { killWithAwait } from '../../process.js';
|
|
5
|
+
// import { Browser, firefox, Page } from 'playwright';
|
|
6
|
+
// import { Config } from '@react-native-harness/config';
|
|
7
|
+
export {};
|
|
8
|
+
// const runBrowser = async (
|
|
9
|
+
// url: string
|
|
10
|
+
// ): Promise<{ browser: Browser; page: Page }> => {
|
|
11
|
+
// const browser = await firefox.launch({
|
|
12
|
+
// headless: false,
|
|
13
|
+
// devtools: false,
|
|
14
|
+
// args: [
|
|
15
|
+
// '--no-sandbox',
|
|
16
|
+
// '--disable-setuid-sandbox',
|
|
17
|
+
// '--disable-dev-shm-usage',
|
|
18
|
+
// '--disable-web-security',
|
|
19
|
+
// '--allow-insecure-localhost',
|
|
20
|
+
// '--ignore-certificate-errors',
|
|
21
|
+
// ],
|
|
22
|
+
// ignoreDefaultArgs: ['--disable-extensions'],
|
|
23
|
+
// });
|
|
24
|
+
// const context = await browser.newContext({
|
|
25
|
+
// bypassCSP: true,
|
|
26
|
+
// ignoreHTTPSErrors: true,
|
|
27
|
+
// });
|
|
28
|
+
// const page = await context.newPage();
|
|
29
|
+
// await page.setViewportSize({ width: 1280, height: 720 });
|
|
30
|
+
// await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 60000 });
|
|
31
|
+
// return { browser, page };
|
|
32
|
+
// };
|
|
33
|
+
// export const webPlatformAdapter: PlatformAdapter = {
|
|
34
|
+
// name: 'web',
|
|
35
|
+
// getEnvironment: async (_config: Config) => {
|
|
36
|
+
// const webpackConfigPath = path.resolve(process.cwd(), 'webpack.config.js');
|
|
37
|
+
// const webpack = await runWebpack(webpackConfigPath);
|
|
38
|
+
// const { browser, page } = await runBrowser('http://localhost:8081');
|
|
39
|
+
// return {
|
|
40
|
+
// restart: async () => {
|
|
41
|
+
// await page.reload({ waitUntil: 'domcontentloaded', timeout: 60000 });
|
|
42
|
+
// },
|
|
43
|
+
// dispose: async () => {
|
|
44
|
+
// await browser.close();
|
|
45
|
+
// await killWithAwait(webpack);
|
|
46
|
+
// },
|
|
47
|
+
// };
|
|
48
|
+
// },
|
|
49
|
+
// };
|
|
50
|
+
// export default webPlatformAdapter;
|
package/dist/process.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-reporter.d.ts","sourceRoot":"","sources":["../../src/reporters/default-reporter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,eAAO,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"default-reporter.d.ts","sourceRoot":"","sources":["../../src/reporters/default-reporter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,eAAO,MAAM,eAAe,EAAE,QAoC7B,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import chalk from 'chalk';
|
|
2
2
|
export const defaultReporter = {
|
|
3
3
|
report: async (results) => {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
console.log('\nš Test Results:');
|
|
5
|
+
console.log(chalk.gray('ā'.repeat(40)));
|
|
6
6
|
for (const suite of results) {
|
|
7
|
-
|
|
7
|
+
console.log(formatSuiteResult(suite));
|
|
8
8
|
}
|
|
9
|
+
console.log(chalk.gray('ā'.repeat(40)));
|
|
9
10
|
// Summary
|
|
10
11
|
let totalPassed = 0, totalFailed = 0, totalSkipped = 0, totalTodo = 0;
|
|
11
12
|
let totalDuration = 0;
|
|
@@ -17,38 +18,32 @@ export const defaultReporter = {
|
|
|
17
18
|
totalTodo += summary.todo;
|
|
18
19
|
totalDuration += suite.duration || 0;
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
color.red(`${totalFailed} failed`),
|
|
23
|
-
color.yellow(`${totalSkipped} skipped`),
|
|
24
|
-
color.blue(`${totalTodo} todo`),
|
|
25
|
-
].join(', ');
|
|
26
|
-
resultsSpinner.message(`Summary: ${summaryText}`);
|
|
27
|
-
resultsSpinner.message(`Total time: ${formatDuration(totalDuration)}`);
|
|
21
|
+
console.log(`\nš Summary: ${chalk.green(`${totalPassed} passed`)}, ${chalk.red(`${totalFailed} failed`)}, ${chalk.yellow(`${totalSkipped} skipped`)}, ${chalk.blue(`${totalTodo} todo`)}`);
|
|
22
|
+
console.log(`ā±ļø Total time: ${formatDuration(totalDuration)}`);
|
|
28
23
|
},
|
|
29
24
|
};
|
|
30
25
|
const formatDuration = (duration) => {
|
|
31
|
-
if (duration
|
|
26
|
+
if (!duration)
|
|
32
27
|
return '';
|
|
33
|
-
return
|
|
28
|
+
return chalk.gray(` (${duration}ms)`);
|
|
34
29
|
};
|
|
35
30
|
const getStatusIcon = (status) => {
|
|
36
31
|
switch (status) {
|
|
37
32
|
case 'passed':
|
|
38
|
-
return
|
|
33
|
+
return chalk.green('ā');
|
|
39
34
|
case 'failed':
|
|
40
|
-
return
|
|
35
|
+
return chalk.red('ā');
|
|
41
36
|
case 'skipped':
|
|
42
|
-
return
|
|
37
|
+
return chalk.yellow('ā');
|
|
43
38
|
case 'todo':
|
|
44
|
-
return
|
|
39
|
+
return chalk.blue('ā');
|
|
45
40
|
default:
|
|
46
41
|
return '?';
|
|
47
42
|
}
|
|
48
43
|
};
|
|
49
44
|
const formatTestResult = (test, indent = '') => {
|
|
50
45
|
const icon = getStatusIcon(test.status);
|
|
51
|
-
const name = test.status === 'failed' ?
|
|
46
|
+
const name = test.status === 'failed' ? chalk.red(test.name) : test.name;
|
|
52
47
|
const duration = formatDuration(test.duration);
|
|
53
48
|
let result = `${indent}${icon} ${name}${duration}`;
|
|
54
49
|
if (test.error) {
|
|
@@ -56,14 +51,14 @@ const formatTestResult = (test, indent = '') => {
|
|
|
56
51
|
result +=
|
|
57
52
|
'\n' +
|
|
58
53
|
errorLines
|
|
59
|
-
.map((line) => `${indent} ${
|
|
54
|
+
.map((line) => `${indent} ${chalk.red(line)}`)
|
|
60
55
|
.join('\n');
|
|
61
56
|
}
|
|
62
57
|
return result;
|
|
63
58
|
};
|
|
64
59
|
const formatSuiteResult = (suite, indent = '') => {
|
|
65
60
|
const icon = getStatusIcon(suite.status);
|
|
66
|
-
const name = suite.status === 'failed' ?
|
|
61
|
+
const name = suite.status === 'failed' ? chalk.red(suite.name) : chalk.bold(suite.name);
|
|
67
62
|
const duration = formatDuration(suite.duration);
|
|
68
63
|
let result = `${indent}${icon} ${name}${duration}`;
|
|
69
64
|
if (suite.error) {
|
|
@@ -71,7 +66,7 @@ const formatSuiteResult = (suite, indent = '') => {
|
|
|
71
66
|
result +=
|
|
72
67
|
'\n' +
|
|
73
68
|
errorLines
|
|
74
|
-
.map((line) => `${indent} ${
|
|
69
|
+
.map((line) => `${indent} ${chalk.red(line)}`)
|
|
75
70
|
.join('\n');
|
|
76
71
|
}
|
|
77
72
|
const childIndent = indent + ' ';
|