@teambit/tester 0.0.760 → 0.0.761
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/test.cmd.d.ts +4 -0
- package/dist/test.cmd.js +7 -3
- package/dist/test.cmd.js.map +1 -1
- package/package-tar/teambit-tester-0.0.761.tgz +0 -0
- package/package.json +16 -16
- package/{preview-1655177322725.js → preview-1655263660719.js} +2 -2
- package/test.cmd.tsx +10 -3
- package/package-tar/teambit-tester-0.0.760.tgz +0 -0
package/dist/test.cmd.d.ts
CHANGED
package/dist/test.cmd.js
CHANGED
|
@@ -86,11 +86,15 @@ class TestCmd {
|
|
|
86
86
|
this.tester = tester;
|
|
87
87
|
this.workspace = workspace;
|
|
88
88
|
this.logger = logger;
|
|
89
|
-
(0, _defineProperty2().default)(this, "name", 'test [pattern]');
|
|
90
|
-
(0, _defineProperty2().default)(this, "description", 'test
|
|
89
|
+
(0, _defineProperty2().default)(this, "name", 'test [component-pattern]');
|
|
90
|
+
(0, _defineProperty2().default)(this, "description", 'test components in the workspace');
|
|
91
|
+
(0, _defineProperty2().default)(this, "arguments", [{
|
|
92
|
+
name: 'component-pattern',
|
|
93
|
+
description: 'the components to test (defaults to all components). use component name, component id, or component pattern. use component pattern to select multiple components. \nuse comma to separate patterns. e.g. "ui/**, pages/**"\nwrap the pattern with quotes (note that the "!" exclusion sign cannot be used here)'
|
|
94
|
+
}]);
|
|
91
95
|
(0, _defineProperty2().default)(this, "alias", 'at');
|
|
92
96
|
(0, _defineProperty2().default)(this, "group", 'development');
|
|
93
|
-
(0, _defineProperty2().default)(this, "options", [['w', 'watch', 'start the tester in watch mode.'], ['d', 'debug', 'start the tester in debug mode.'], ['a', 'all', 'test all components, not only new and modified'], ['', 'junit <filepath>', 'write tests results as JUnit XML format into the specified file path'], ['', 'coverage', 'show code coverage data'], ['e', 'env <id>', 'test only the given env'], ['s', 'scope <scope>', 'name of the scope to test'] // TODO: we need to reduce this redundant casting every time.
|
|
97
|
+
(0, _defineProperty2().default)(this, "options", [['w', 'watch', 'start the tester in watch mode.'], ['d', 'debug', 'start the tester in debug mode.'], ['a', 'all', 'test all components, not only new and modified'], ['', 'junit <filepath>', 'write tests results as JUnit XML format into the specified file path'], ['', 'coverage', 'show code coverage data'], ['e', 'env <id>', 'test only the given env'], ['s', 'scope <scope-name>', 'name of the scope to test'] // TODO: we need to reduce this redundant casting every time.
|
|
94
98
|
]);
|
|
95
99
|
}
|
|
96
100
|
|
package/dist/test.cmd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TestCmd","constructor","tester","workspace","logger","render","userPattern","watch","debug","all","env","scope","junit","coverage","timer","Timer","create","scopeName","undefined","start","ConsumerNotFound","getPatternWithScope","pattern","patternWithScope","components","getComponentsByUserInput","length","NoMatchingComponents","code","data","console","chalk","cyan","
|
|
1
|
+
{"version":3,"names":["TestCmd","constructor","tester","workspace","logger","name","description","render","userPattern","watch","debug","all","env","scope","junit","coverage","timer","Timer","create","scopeName","undefined","start","ConsumerNotFound","getPatternWithScope","pattern","patternWithScope","components","getComponentsByUserInput","length","NoMatchingComponents","code","data","console","chalk","cyan","off","tests","test","hasErrors","seconds","stop"],"sources":["test.cmd.tsx"],"sourcesContent":["import { Command, CommandOptions } from '@teambit/cli';\nimport chalk from 'chalk';\nimport { Logger } from '@teambit/logger';\nimport { Workspace } from '@teambit/workspace';\nimport { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';\nimport { Timer } from '@teambit/legacy/dist/toolbox/timer';\nimport { Box, Text } from 'ink';\nimport React from 'react';\nimport { NoMatchingComponents } from './exceptions';\n\nimport type { TesterMain } from './tester.main.runtime';\n\ntype TestFlags = {\n watch: boolean;\n debug: boolean;\n all: boolean;\n env?: string;\n scope?: string;\n junit?: string;\n coverage?: boolean;\n};\n\nexport class TestCmd implements Command {\n name = 'test [component-pattern]';\n description = 'test components in the workspace';\n arguments = [\n {\n name: 'component-pattern',\n description:\n 'the components to test (defaults to all components). use component name, component id, or component pattern. use component pattern to select multiple components. \\nuse comma to separate patterns. e.g. \"ui/**, pages/**\"\\nwrap the pattern with quotes (note that the \"!\" exclusion sign cannot be used here)',\n },\n ];\n alias = 'at';\n group = 'development';\n options = [\n ['w', 'watch', 'start the tester in watch mode.'],\n ['d', 'debug', 'start the tester in debug mode.'],\n ['a', 'all', 'test all components, not only new and modified'],\n ['', 'junit <filepath>', 'write tests results as JUnit XML format into the specified file path'],\n ['', 'coverage', 'show code coverage data'],\n ['e', 'env <id>', 'test only the given env'],\n ['s', 'scope <scope-name>', 'name of the scope to test'],\n // TODO: we need to reduce this redundant casting every time.\n ] as CommandOptions;\n\n constructor(private tester: TesterMain, private workspace: Workspace, private logger: Logger) {}\n\n async render(\n [userPattern]: [string],\n { watch = false, debug = false, all = false, env, scope, junit, coverage = false }: TestFlags\n ) {\n const timer = Timer.create();\n const scopeName = typeof scope === 'string' ? scope : undefined;\n timer.start();\n if (!this.workspace) throw new ConsumerNotFound();\n\n const getPatternWithScope = () => {\n if (!userPattern && !scope) return undefined;\n const pattern = userPattern || '**';\n return scopeName ? `${scopeName}/${pattern}` : pattern;\n };\n const patternWithScope = getPatternWithScope();\n const components = await this.workspace.getComponentsByUserInput(all, patternWithScope, true);\n if (!components.length) {\n if (userPattern) throw new NoMatchingComponents(userPattern);\n return {\n code: 0,\n data: (\n <Box>\n <Text bold>\n no components found to test. use \"--all\" flag to test all components or specify the ids to test,\n otherwise, only new and modified components will be tested{' '}\n </Text>\n </Box>\n ),\n };\n }\n\n this.logger.console(\n `testing total of ${components.length} components in workspace '${chalk.cyan(this.workspace.name)}'`\n );\n\n let code = 0;\n if (watch && !debug) {\n // avoid turning off the logger for non-watch scenario. otherwise, when this aspect throws errors, they'll be\n // swallowed. (Jest errors are shown regardless via Jest, but if the tester is unable to run Jest in the first\n // place, these errors won't be shown)\n this.logger.off();\n await this.tester.watch(components, {\n watch,\n debug,\n env,\n coverage,\n });\n } else {\n const tests = await this.tester.test(components, {\n watch,\n debug,\n env,\n junit,\n coverage,\n });\n if (tests.hasErrors()) code = 1;\n }\n const { seconds } = timer.stop();\n\n if (watch) return <Box></Box>;\n return {\n code,\n data: (\n <Box>\n <Text>test has been completed in </Text>\n <Text color=\"cyan\">{seconds} </Text>\n <Text>seconds.</Text>\n </Box>\n ),\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAcO,MAAMA,OAAN,CAAiC;EAuBtCC,WAAW,CAASC,MAAT,EAAqCC,SAArC,EAAmEC,MAAnE,EAAmF;IAAA,KAA1EF,MAA0E,GAA1EA,MAA0E;IAAA,KAA9CC,SAA8C,GAA9CA,SAA8C;IAAA,KAAhBC,MAAgB,GAAhBA,MAAgB;IAAA,8CAtBvF,0BAsBuF;IAAA,qDArBhF,kCAqBgF;IAAA,mDApBlF,CACV;MACEC,IAAI,EAAE,mBADR;MAEEC,WAAW,EACT;IAHJ,CADU,CAoBkF;IAAA,+CAbtF,IAasF;IAAA,+CAZtF,aAYsF;IAAA,iDAXpF,CACR,CAAC,GAAD,EAAM,OAAN,EAAe,iCAAf,CADQ,EAER,CAAC,GAAD,EAAM,OAAN,EAAe,iCAAf,CAFQ,EAGR,CAAC,GAAD,EAAM,KAAN,EAAa,gDAAb,CAHQ,EAIR,CAAC,EAAD,EAAK,kBAAL,EAAyB,sEAAzB,CAJQ,EAKR,CAAC,EAAD,EAAK,UAAL,EAAiB,yBAAjB,CALQ,EAMR,CAAC,GAAD,EAAM,UAAN,EAAkB,yBAAlB,CANQ,EAOR,C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AO,6BAA4BK,gBAAA,CAAMC,IAAN,CAAW,KAAK/B,SAAL,CAAeE,IAA1B,CAAgC,GADpG;IAIA,IAAIyB,IAAI,GAAG,CAAX;;IACA,IAAIrB,KAAK,IAAI,CAACC,KAAd,EAAqB;MACnB;MACA;MACA;MACA,KAAKN,MAAL,CAAY+B,GAAZ;MACA,MAAM,KAAKjC,MAAL,CAAYO,KAAZ,CAAkBiB,UAAlB,EAA8B;QAClCjB,KADkC;QAElCC,KAFkC;QAGlCE,GAHkC;QAIlCG;MAJkC,CAA9B,CAAN;IAMD,CAXD,MAWO;MACL,MAAMqB,KAAK,GAAG,MAAM,KAAKlC,MAAL,CAAYmC,IAAZ,CAAiBX,UAAjB,EAA6B;QAC/CjB,KAD+C;QAE/CC,KAF+C;QAG/CE,GAH+C;QAI/CE,KAJ+C;QAK/CC;MAL+C,CAA7B,CAApB;MAOA,IAAIqB,KAAK,CAACE,SAAN,EAAJ,EAAuBR,IAAI,GAAG,CAAP;IACxB;;IACD,MAAM;MAAES;IAAF,IAAcvB,KAAK,CAACwB,IAAN,EAApB;IAEA,IAAI/B,KAAJ,EAAW,oBAAO,+BAAC,UAAD,OAAP;IACX,OAAO;MACLqB,IADK;MAELC,IAAI,eACF,+BAAC,UAAD,qBACE,+BAAC,WAAD,sCADF,eAEE,+BAAC,WAAD;QAAM,KAAK,EAAC;MAAZ,GAAoBQ,OAApB,MAFF,eAGE,+BAAC,WAAD,mBAHF;IAHG,CAAP;EAUD;;AA/FqC"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/tester",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.761",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/defender/tester",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.defender",
|
|
8
8
|
"name": "tester",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.761"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
"@teambit/harmony": "0.3.3",
|
|
26
26
|
"@teambit/design.ui.separator": "0.0.354",
|
|
27
27
|
"@teambit/documenter.ui.heading": "4.1.1",
|
|
28
|
-
"@teambit/cli": "0.0.
|
|
29
|
-
"@teambit/logger": "0.0.
|
|
30
|
-
"@teambit/workspace": "0.0.
|
|
31
|
-
"@teambit/component": "0.0.
|
|
32
|
-
"@teambit/defender.ui.test-compare": "0.0.
|
|
33
|
-
"@teambit/graphql": "0.0.
|
|
34
|
-
"@teambit/builder": "0.0.
|
|
35
|
-
"@teambit/dev-files": "0.0.
|
|
36
|
-
"@teambit/envs": "0.0.
|
|
28
|
+
"@teambit/cli": "0.0.503",
|
|
29
|
+
"@teambit/logger": "0.0.596",
|
|
30
|
+
"@teambit/workspace": "0.0.761",
|
|
31
|
+
"@teambit/component": "0.0.761",
|
|
32
|
+
"@teambit/defender.ui.test-compare": "0.0.8",
|
|
33
|
+
"@teambit/graphql": "0.0.761",
|
|
34
|
+
"@teambit/builder": "0.0.761",
|
|
35
|
+
"@teambit/dev-files": "0.0.761",
|
|
36
|
+
"@teambit/envs": "0.0.761",
|
|
37
37
|
"@teambit/tests-results": "0.0.97",
|
|
38
|
-
"@teambit/ui": "0.0.
|
|
39
|
-
"@teambit/compiler": "0.0.
|
|
40
|
-
"@teambit/component-compare": "0.0.
|
|
38
|
+
"@teambit/ui": "0.0.761",
|
|
39
|
+
"@teambit/compiler": "0.0.761",
|
|
40
|
+
"@teambit/component-compare": "0.0.9",
|
|
41
41
|
"@teambit/bit-error": "0.0.394",
|
|
42
42
|
"@teambit/defender.ui.test-loader": "0.0.490",
|
|
43
43
|
"@teambit/defender.ui.test-table": "0.0.495",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@apollo/client": "^3.0.0",
|
|
64
|
-
"@teambit/legacy": "1.0.
|
|
64
|
+
"@teambit/legacy": "1.0.283",
|
|
65
65
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
66
66
|
"react": "^16.8.0 || ^17.0.0"
|
|
67
67
|
},
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"react": "-"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
|
-
"@teambit/legacy": "1.0.
|
|
92
|
+
"@teambit/legacy": "1.0.283",
|
|
93
93
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
94
94
|
"react": "^16.8.0 || ^17.0.0"
|
|
95
95
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_tester@0.0.
|
|
2
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_tester@0.0.
|
|
1
|
+
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_tester@0.0.761/dist/tester.composition.js')]
|
|
2
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.defender_tester@0.0.761/dist/tester.docs.mdx')]
|
package/test.cmd.tsx
CHANGED
|
@@ -21,8 +21,15 @@ type TestFlags = {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export class TestCmd implements Command {
|
|
24
|
-
name = 'test [pattern]';
|
|
25
|
-
description = 'test
|
|
24
|
+
name = 'test [component-pattern]';
|
|
25
|
+
description = 'test components in the workspace';
|
|
26
|
+
arguments = [
|
|
27
|
+
{
|
|
28
|
+
name: 'component-pattern',
|
|
29
|
+
description:
|
|
30
|
+
'the components to test (defaults to all components). use component name, component id, or component pattern. use component pattern to select multiple components. \nuse comma to separate patterns. e.g. "ui/**, pages/**"\nwrap the pattern with quotes (note that the "!" exclusion sign cannot be used here)',
|
|
31
|
+
},
|
|
32
|
+
];
|
|
26
33
|
alias = 'at';
|
|
27
34
|
group = 'development';
|
|
28
35
|
options = [
|
|
@@ -32,7 +39,7 @@ export class TestCmd implements Command {
|
|
|
32
39
|
['', 'junit <filepath>', 'write tests results as JUnit XML format into the specified file path'],
|
|
33
40
|
['', 'coverage', 'show code coverage data'],
|
|
34
41
|
['e', 'env <id>', 'test only the given env'],
|
|
35
|
-
['s', 'scope <scope>', 'name of the scope to test'],
|
|
42
|
+
['s', 'scope <scope-name>', 'name of the scope to test'],
|
|
36
43
|
// TODO: we need to reduce this redundant casting every time.
|
|
37
44
|
] as CommandOptions;
|
|
38
45
|
|
|
Binary file
|