@teambit/component.testing.mock-components 0.0.276 → 0.0.278
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/mock-components.js
CHANGED
|
@@ -12,7 +12,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.
|
|
15
|
+
exports.mockComponents = mockComponents;
|
|
16
|
+
exports.modifyMockedComponents = modifyMockedComponents;
|
|
16
17
|
const compiler_1 = require("@teambit/compiler");
|
|
17
18
|
const harmony_testing_load_aspect_1 = require("@teambit/harmony.testing.load-aspect");
|
|
18
19
|
const workspace_1 = require("@teambit/workspace");
|
|
@@ -25,8 +26,8 @@ const tracker_1 = require("@teambit/tracker");
|
|
|
25
26
|
* create dummy components, add, link and compile them.
|
|
26
27
|
* if `numOfComponents` is more than one, the components will depend on each other. by default, it's one.
|
|
27
28
|
*/
|
|
28
|
-
function mockComponents(
|
|
29
|
-
return __awaiter(this,
|
|
29
|
+
function mockComponents(workspacePath_1) {
|
|
30
|
+
return __awaiter(this, arguments, void 0, function* (workspacePath, { numOfComponents = 1, additionalStr = '' } = {}) {
|
|
30
31
|
const compsDirs = yield createComponents(workspacePath, { numOfComponents, additionalStr });
|
|
31
32
|
const harmony = yield (0, harmony_testing_load_aspect_1.loadManyAspects)([workspace_1.WorkspaceAspect, tracker_1.TrackerAspect, install_1.InstallAspect, compiler_1.CompilerAspect], workspacePath);
|
|
32
33
|
const workspace = harmony.get(workspace_1.WorkspaceAspect.id);
|
|
@@ -43,18 +44,16 @@ function mockComponents(workspacePath, { numOfComponents = 1, additionalStr = ''
|
|
|
43
44
|
return results;
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
|
-
exports.mockComponents = mockComponents;
|
|
47
47
|
/**
|
|
48
48
|
* make the mocked components modified by appending the `additionalStr` to the component files
|
|
49
49
|
*/
|
|
50
|
-
function modifyMockedComponents(
|
|
51
|
-
return __awaiter(this,
|
|
50
|
+
function modifyMockedComponents(workspacePath_1) {
|
|
51
|
+
return __awaiter(this, arguments, void 0, function* (workspacePath, additionalStr = ' ', { numOfComponents = 1 } = {}) {
|
|
52
52
|
yield createComponents(workspacePath, { numOfComponents, additionalStr });
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
function
|
|
57
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
function createComponents(workspacePath_1) {
|
|
56
|
+
return __awaiter(this, arguments, void 0, function* (workspacePath, { numOfComponents = 1, additionalStr = '' } = {}) {
|
|
58
57
|
const getImp = (index) => {
|
|
59
58
|
if (index === numOfComponents)
|
|
60
59
|
return `module.exports = () => 'comp${index}${additionalStr}';`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-components.js","sourceRoot":"","sources":["../mock-components.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mock-components.js","sourceRoot":"","sources":["../mock-components.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAuBA,wCAoBC;AAKD,wDAEC;AAlDD,gDAAiE;AACjE,sFAAuE;AACvE,kDAAgE;AAChE,8CAAiD;AAEjD,wDAA0B;AAC1B,gEAAsC;AACtC,gDAAwB;AACxB,8CAA8D;AAW9D;;;GAGG;AACH,SAAsB,cAAc;yDAClC,aAAqB,EACrB,EAAE,eAAe,GAAG,CAAC,EAAE,aAAa,GAAG,EAAE,EAAE,GAAG,EAAE;QAEhD,MAAM,SAAS,GAAG,MAAM,gBAAgB,CAAC,aAAa,EAAE,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC,CAAC;QAC5F,MAAM,OAAO,GAAG,MAAM,IAAA,6CAAe,EAAC,CAAC,2BAAe,EAAE,uBAAa,EAAE,uBAAa,EAAE,yBAAc,CAAC,EAAE,aAAa,CAAC,CAAC;QACtH,MAAM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AAe;gBAAE,OAAO,+BAA+B,KAAK,GAAG,aAAa,IAAI,CAAC;YAC/F,MAAM,QAAQ,GAAG,OAAO,KAAK,GAAG,CAAC,EAAE,CAAC;YACpC,OAAO,SAAS,QAAQ,kBAAkB,QAAQ;8BACxB,KAAK,GAAG,aAAa,YAAY,QAAQ,KAAK,CAAC;QAC3E,CAAC,CAAC;QAEF,MAAM,kBAAkB,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7D,OAAO,IAAA,sBAAU,EAAC,kBAAkB,EAAE,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;YACvD,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;YAClB,MAAM,OAAO,GAAG,cAAI,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;YACrD,MAAM,kBAAE,CAAC,UAAU,CAAC,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/D,OAAO,OAAO,CAAC;QACjB,CAAC,CAAA,CAAC,CAAC;IACL,CAAC;CAAA"}
|
package/package.json
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/component.testing.mock-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.278",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/component/testing/mock-components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.component",
|
|
8
8
|
"name": "testing/mock-components",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.278"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"fs-extra": "10.0.0",
|
|
13
13
|
"p-map-series": "2.1.0",
|
|
14
14
|
"@teambit/component-id": "1.2.2",
|
|
15
|
-
"@teambit/harmony.testing.load-aspect": "0.0.
|
|
15
|
+
"@teambit/harmony.testing.load-aspect": "0.0.273"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/fs-extra": "9.0.7",
|
|
19
19
|
"@types/mocha": "9.1.0",
|
|
20
20
|
"@types/jest": "26.0.20",
|
|
21
|
-
"@types/node": "
|
|
22
|
-
"@babel/runtime": "7.20.0"
|
|
21
|
+
"@types/node": "22.10.5"
|
|
23
22
|
},
|
|
24
23
|
"peerDependencies": {},
|
|
25
24
|
"license": "Apache-2.0",
|
|
File without changes
|