@rpcbase/test 0.0.0 → 0.2.0

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/cli.js CHANGED
@@ -1,18 +1,66 @@
1
1
  #!/usr/bin/env node
2
- import fs from 'fs';
3
- import path from 'path';
4
- import { runCLI } from '@playwright/test/cli';
5
- const run = async () => {
6
- const configPath = fs.existsSync(path.join(process.cwd(), 'playwright.config.ts'))
7
- ? 'playwright.config.ts'
8
- : path.join(__dirname, 'playwright.config.ts');
9
- const result = await runCLI([`--config=${configPath}`]); // Pass any CLI options here
10
- if (result.exitCode !== 0) {
11
- console.error('Tests failed!');
12
- process.exit(result.exitCode);
13
- }
14
- else {
15
- console.log('All tests passed!');
2
+ "use strict";
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
12
+ var __generator = (this && this.__generator) || function (thisArg, body) {
13
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
14
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
15
+ function verb(n) { return function (v) { return step([n, v]); }; }
16
+ function step(op) {
17
+ if (f) throw new TypeError("Generator is already executing.");
18
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
19
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
20
+ if (y = 0, t) op = [op[0] & 2, t.value];
21
+ switch (op[0]) {
22
+ case 0: case 1: t = op; break;
23
+ case 4: _.label++; return { value: op[1], done: false };
24
+ case 5: _.label++; y = op[1]; op = [0]; continue;
25
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
26
+ default:
27
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
28
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
29
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
30
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
31
+ if (t[2]) _.ops.pop();
32
+ _.trys.pop(); continue;
33
+ }
34
+ op = body.call(thisArg, _);
35
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
36
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
16
37
  }
17
38
  };
39
+ Object.defineProperty(exports, "__esModule", { value: true });
40
+ var fs_1 = require("fs");
41
+ var path_1 = require("path");
42
+ // @ts-ignore
43
+ var cli_1 = require("@playwright/test/cli");
44
+ var run = function () { return __awaiter(void 0, void 0, void 0, function () {
45
+ var configPath, result;
46
+ return __generator(this, function (_a) {
47
+ switch (_a.label) {
48
+ case 0:
49
+ configPath = fs_1.default.existsSync(path_1.default.join(process.cwd(), 'playwright.config.ts'))
50
+ ? 'playwright.config.ts'
51
+ : path_1.default.join(__dirname, 'playwright.config.ts');
52
+ return [4 /*yield*/, (0, cli_1.runCLI)(["--config=".concat(configPath)])];
53
+ case 1:
54
+ result = _a.sent();
55
+ if (result.exitCode !== 0) {
56
+ console.error('Tests failed!');
57
+ process.exit(result.exitCode);
58
+ }
59
+ else {
60
+ console.log('All tests passed!');
61
+ }
62
+ return [2 /*return*/];
63
+ }
64
+ });
65
+ }); };
18
66
  run();
package/package.json CHANGED
@@ -1,19 +1,24 @@
1
1
  {
2
2
  "name": "@rpcbase/test",
3
- "version": "0.0.0",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
- "main": "./src/index.ts",
6
5
  "bin": {
7
6
  "rb-test": "./dist/cli.js"
8
7
  },
9
8
  "scripts": {
10
- "build": "tsc --watch",
9
+ "build": "wireit",
11
10
  "release": "wireit"
12
11
  },
13
12
  "wireit": {
13
+ "build": {
14
+ "command": "tsc ./src/cli.ts --noEmit false --outDir ./dist || true",
15
+ "dependencies": []
16
+ },
14
17
  "release": {
15
18
  "command": "../../scripts/publish.js",
16
- "dependencies": [],
19
+ "dependencies": [
20
+ "build"
21
+ ],
17
22
  "files": [
18
23
  "package.json"
19
24
  ],
package/dist/cli.d.ts DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=cli.d.ts.map
package/dist/cli.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/index.d.ts DELETED
@@ -1 +0,0 @@
1
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js DELETED
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,13 +0,0 @@
1
- import { LoaderFunction } from "react-router";
2
- import { Loader } from "@rpcbase/client";
3
- type RouteModule = {
4
- default: React.ComponentType<unknown>;
5
- loader?: Loader;
6
- };
7
- type RouteWithLoader = {
8
- Component: React.LazyExoticComponent<React.ComponentType<unknown>>;
9
- loader?: LoaderFunction;
10
- };
11
- export declare const loadRoute: (importPromise: Promise<RouteModule>) => RouteWithLoader;
12
- export {};
13
- //# sourceMappingURL=loadRoute.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"loadRoute.d.ts","sourceRoot":"","sources":["../src/loadRoute.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,OAAO,EAAE,MAAM,EAAc,MAAM,iBAAiB,CAAA;AAGpD,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;IACrC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,KAAK,eAAe,GAAG;IACrB,SAAS,EAAE,KAAK,CAAC,mBAAmB,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAA;IAClE,MAAM,CAAC,EAAE,cAAc,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,SAAS,kBAAmB,OAAO,CAAC,WAAW,CAAC,KAAG,eAa/D,CAAA"}
package/dist/loadRoute.js DELETED
@@ -1,14 +0,0 @@
1
- import { lazy } from "react";
2
- export const loadRoute = (importPromise) => {
3
- const Component = lazy(async () => {
4
- const module = await importPromise;
5
- return { default: module.default };
6
- });
7
- const loader = async (args) => {
8
- const module = await importPromise;
9
- if (!module.loader)
10
- return null;
11
- return module.loader(args);
12
- };
13
- return { Component, loader: loader };
14
- };
@@ -1,2 +0,0 @@
1
- export declare const runPlaywright: () => Promise<void>;
2
- //# sourceMappingURL=runPlaywright.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runPlaywright.d.ts","sourceRoot":"","sources":["../src/runPlaywright.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,qBAEzB,CAAA"}
@@ -1,2 +0,0 @@
1
- export const runPlaywright = async () => {
2
- };