@gnuechtel/shared-e2e 0.0.33

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/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # shared-e2e
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build shared-e2e` to build the library.
8
+
9
+ ## Running unit tests
10
+
11
+ Run `nx test shared-e2e` to execute the unit tests via [Jest](https://jestjs.io).
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "@gnuechtel/shared-e2e",
3
+ "version": "0.0.33",
4
+ "dependencies": {
5
+ "tslib": "^2.3.0",
6
+ "@gnuechtel/shared-coverage": "^0.0.33",
7
+ "@playwright/test": "^1.21.1"
8
+ },
9
+ "type": "commonjs",
10
+ "main": "./src/index.js",
11
+ "typings": "./src/index.d.ts"
12
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './lib/coverage-setup';
2
+ export * from './lib/coverage-test-base';
package/src/index.js ADDED
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./lib/coverage-setup"), exports);
5
+ tslib_1.__exportStar(require("./lib/coverage-test-base"), exports);
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/shared/e2e/src/index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC;AACrC,mEAAyC"}
@@ -0,0 +1,2 @@
1
+ export declare function coverageSetup(): Promise<void>;
2
+ export declare function coverageTeardown(customProjectDirectory?: string): Promise<void>;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.coverageTeardown = exports.coverageSetup = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const shared_coverage_1 = require("@gnuechtel/shared-coverage");
6
+ const path = require("path");
7
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
8
+ const debug = require('debug')('e2e:hooks');
9
+ function coverageSetup() {
10
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
11
+ debug('coverageSetup - Deleting existing coverage files');
12
+ (0, shared_coverage_1.deleteExistingPlaywrightCoverageFiles)();
13
+ debug('coverageSetup - Existing coverage files deleted');
14
+ });
15
+ }
16
+ exports.coverageSetup = coverageSetup;
17
+ function coverageTeardown(customProjectDirectory) {
18
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
19
+ debug('globalTeardown - Creating Istanbul coverage report');
20
+ try {
21
+ const rootDirectory = path.resolve(path.join(__dirname, '..', '..', '..', '..', '..'));
22
+ const projectDirectory = customProjectDirectory || path.resolve(process.cwd());
23
+ yield (0, shared_coverage_1.createIstanbulCoverageReports)(rootDirectory, projectDirectory);
24
+ debug('coverageTeardown - Istanbul coverage report created');
25
+ }
26
+ catch (e) {
27
+ debug('coverageTeardown - Could not create Istanbul coverage report: %O', e);
28
+ }
29
+ });
30
+ }
31
+ exports.coverageTeardown = coverageTeardown;
32
+ //# sourceMappingURL=coverage-setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coverage-setup.js","sourceRoot":"","sources":["../../../../../../libs/shared/e2e/src/lib/coverage-setup.ts"],"names":[],"mappings":";;;;AAAA,gEAAkH;AAClH,6BAA6B;AAE7B,8DAA8D;AAC9D,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC;AAE5C,SAAsB,aAAa;;QACjC,KAAK,CAAC,kDAAkD,CAAC,CAAC;QAC1D,IAAA,uDAAqC,GAAE,CAAC;QACxC,KAAK,CAAC,iDAAiD,CAAC,CAAC;IAC3D,CAAC;CAAA;AAJD,sCAIC;AAED,SAAsB,gBAAgB,CAAC,sBAA+B;;QACpE,KAAK,CAAC,oDAAoD,CAAC,CAAC;QAC5D,IAAI;YACF,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;YACvF,MAAM,gBAAgB,GAAG,sBAAsB,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;YAC/E,MAAM,IAAA,+CAA6B,EAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;YACrE,KAAK,CAAC,qDAAqD,CAAC,CAAC;SAC9D;QAAC,OAAO,CAAC,EAAE;YACV,KAAK,CAAC,kEAAkE,EAAE,CAAC,CAAC,CAAC;SAC9E;IACH,CAAC;CAAA;AAVD,4CAUC"}
@@ -0,0 +1,3 @@
1
+ export declare const test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & {
2
+ [key: string]: any;
3
+ }, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions>;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.test = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const test_1 = require("@playwright/test");
6
+ const shared_coverage_1 = require("@gnuechtel/shared-coverage");
7
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
8
+ const debug = require('debug')('e2e:hooks');
9
+ exports.test = test_1.test.extend({
10
+ context: ({ context }, use) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
11
+ yield (0, shared_coverage_1.prepareContextForIstanbulCoverage)(context);
12
+ yield use(context);
13
+ try {
14
+ debug('testBase - Collecting coverage');
15
+ yield (0, shared_coverage_1.collectIstanbulCoverageForContext)(context);
16
+ debug('testBase - Coverage collected');
17
+ }
18
+ catch (e) {
19
+ debug('testBase - Could not create coverage: %O', e);
20
+ }
21
+ }),
22
+ });
23
+ //# sourceMappingURL=coverage-test-base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coverage-test-base.js","sourceRoot":"","sources":["../../../../../../libs/shared/e2e/src/lib/coverage-test-base.ts"],"names":[],"mappings":";;;;AAAA,2CAAgD;AAChD,gEAAkH;AAElH,8DAA8D;AAC9D,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC;AAE/B,QAAA,IAAI,GAAG,WAAI,CAAC,MAAM,CAAC;IAC9B,OAAO,EAAE,CAAO,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE;QAClC,MAAM,IAAA,mDAAiC,EAAC,OAAO,CAAC,CAAC;QACjD,MAAM,GAAG,CAAC,OAAO,CAAC,CAAC;QACnB,IAAI;YACF,KAAK,CAAC,gCAAgC,CAAC,CAAC;YACxC,MAAM,IAAA,mDAAiC,EAAC,OAAO,CAAC,CAAC;YACjD,KAAK,CAAC,+BAA+B,CAAC,CAAC;SACxC;QAAC,OAAO,CAAC,EAAE;YACV,KAAK,CAAC,0CAA0C,EAAE,CAAC,CAAC,CAAC;SACtD;IACH,CAAC,CAAA;CACF,CAAC,CAAC"}