@autometa/jest-executor 0.6.3 → 1.0.0-rc.2

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 CHANGED
@@ -1,3 +1,3 @@
1
1
  # Introduction
2
2
 
3
- There's nothing here yet
3
+ There's nothing here yet
package/dist/index.cjs ADDED
@@ -0,0 +1,41 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var executor = require('@autometa/executor');
6
+
7
+ // src/index.ts
8
+ var runtime = {
9
+ suite: describe,
10
+ test: it,
11
+ beforeAll,
12
+ afterAll,
13
+ beforeEach,
14
+ afterEach,
15
+ currentTestName: () => expect.getState().currentTestName,
16
+ retry: (count) => {
17
+ if (typeof jest?.retryTimes === "function") {
18
+ jest.retryTimes(count);
19
+ }
20
+ },
21
+ warn: (message) => {
22
+ console.warn(message);
23
+ },
24
+ logError: (error) => {
25
+ console.error(error);
26
+ }
27
+ };
28
+ function execute(options) {
29
+ executor.registerFeaturePlan({
30
+ plan: options.plan,
31
+ adapter: options.adapter,
32
+ config: options.config,
33
+ runtime
34
+ });
35
+ }
36
+ var src_default = { execute };
37
+
38
+ exports.default = src_default;
39
+ exports.execute = execute;
40
+ //# sourceMappingURL=out.js.map
41
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";AAKA,SAAS,2BAA2B;AAWpC,IAAM,UAA2B;AAAA,EAC/B,OAAO;AAAA,EACP,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB,MAAM,OAAO,SAAS,EAAE;AAAA,EACzC,OAAO,CAAC,UAAkB;AACxB,QAAI,OAAO,MAAM,eAAe,YAAY;AAC1C,WAAK,WAAW,KAAK;AAAA,IACvB;AAAA,EACF;AAAA,EACA,MAAM,CAAC,YAAoB;AACzB,YAAQ,KAAK,OAAO;AAAA,EACtB;AAAA,EACA,UAAU,CAAC,UAAiB;AAC1B,YAAQ,MAAM,KAAK;AAAA,EACrB;AACF;AAQO,SAAS,QAAe,SAAsC;AACnE,sBAAoB;AAAA,IAClB,MAAM,QAAQ;AAAA,IACd,SAAS,QAAQ;AAAA,IACjB,QAAQ,QAAQ;AAAA,IAChB;AAAA,EACF,CAAC;AACH;AAEA,IAAO,cAAQ,EAAE,QAAQ","sourcesContent":["import type { ExecutorConfig } from \"@autometa/config\";\nimport type { ScopeExecutionAdapter } from \"@autometa/scopes\";\nimport type { TestPlan } from \"@autometa/test-builder\";\n\nimport type { ExecutorRuntime } from \"@autometa/executor\";\nimport { registerFeaturePlan } from \"@autometa/executor\";\n\ndeclare const describe: ExecutorRuntime[\"suite\"];\ndeclare const it: ExecutorRuntime[\"test\"];\ndeclare const beforeAll: ExecutorRuntime[\"beforeAll\"];\ndeclare const afterAll: ExecutorRuntime[\"afterAll\"];\ndeclare const beforeEach: ExecutorRuntime[\"beforeEach\"];\ndeclare const afterEach: ExecutorRuntime[\"afterEach\"];\ndeclare const expect: { getState(): { currentTestName?: string } };\ndeclare const jest: { retryTimes?(count: number): void } | undefined;\n\nconst runtime: ExecutorRuntime = {\n suite: describe,\n test: it,\n beforeAll,\n afterAll,\n beforeEach,\n afterEach,\n currentTestName: () => expect.getState().currentTestName,\n retry: (count: number) => {\n if (typeof jest?.retryTimes === \"function\") {\n jest.retryTimes(count);\n }\n },\n warn: (message: string) => {\n console.warn(message);\n },\n logError: (error: Error) => {\n console.error(error);\n },\n};\n\nexport interface ExecuteOptions<World> {\n readonly plan: TestPlan<World>;\n readonly adapter: ScopeExecutionAdapter<World>;\n readonly config: ExecutorConfig;\n}\n\nexport function execute<World>(options: ExecuteOptions<World>): void {\n registerFeaturePlan({\n plan: options.plan,\n adapter: options.adapter,\n config: options.config,\n runtime,\n });\n}\n\nexport default { execute };"]}
package/dist/index.d.ts CHANGED
@@ -1,15 +1,13 @@
1
- import { FeatureBridge } from '@autometa/test-builder';
2
- import { App, World } from '@autometa/app';
3
- import { Class } from '@autometa/types';
4
- import { TestEventEmitter } from '@autometa/events';
5
- import { Config } from '@autometa/config';
6
- import { GlobalScope, Timeout } from '@autometa/scopes';
7
-
8
- declare function execute({ app, world }: {
9
- app: Class<App>;
10
- world: Class<World>;
11
- }, global: GlobalScope, bridge: FeatureBridge, events: TestEventEmitter, config: Config): void;
12
-
13
- declare function getTimeout(target: Timeout | undefined, config: Config): Timeout;
14
-
15
- export { execute as default, execute, getTimeout };
1
+ import type { ExecutorConfig } from "@autometa/config";
2
+ import type { ScopeExecutionAdapter } from "@autometa/scopes";
3
+ import type { TestPlan } from "@autometa/test-builder";
4
+ export interface ExecuteOptions<World> {
5
+ readonly plan: TestPlan<World>;
6
+ readonly adapter: ScopeExecutionAdapter<World>;
7
+ readonly config: ExecutorConfig;
8
+ }
9
+ export declare function execute<World>(options: ExecuteOptions<World>): void;
10
+ declare const _default: {
11
+ execute: typeof execute;
12
+ };
13
+ export default _default;