@autometa/vitest-executor 1.0.0-rc.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) undefined Ben Aherne
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # Introduction
2
+
3
+ There's nothing here yet
package/dist/index.cjs ADDED
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var executor = require('@autometa/executor');
6
+ var vitest = require('vitest');
7
+
8
+ // src/index.ts
9
+ var runtime = {
10
+ suite: vitest.describe,
11
+ test: vitest.it,
12
+ beforeAll: vitest.beforeAll,
13
+ afterAll: vitest.afterAll,
14
+ beforeEach: vitest.beforeEach,
15
+ afterEach: vitest.afterEach,
16
+ currentTestName: () => vitest.expect.getState().currentTestName,
17
+ retry: (count) => {
18
+ const retry = vitest.it.retry;
19
+ if (typeof retry === "function") {
20
+ retry(count);
21
+ }
22
+ },
23
+ warn: (message) => {
24
+ console.warn(message);
25
+ },
26
+ logError: (error) => {
27
+ console.error(error);
28
+ }
29
+ };
30
+ function execute(options) {
31
+ executor.registerFeaturePlan({
32
+ plan: options.plan,
33
+ adapter: options.adapter,
34
+ config: options.config,
35
+ runtime
36
+ });
37
+ }
38
+ var src_default = { execute };
39
+
40
+ exports.default = src_default;
41
+ exports.execute = execute;
42
+ //# sourceMappingURL=out.js.map
43
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";AAKA,SAAS,2BAA2B;AACpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,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,UAAM,QAAS,GAA0D;AACzE,QAAI,OAAO,UAAU,YAAY;AAC/B,YAAM,KAAK;AAAA,IACb;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\";\nimport {\n afterAll,\n afterEach,\n beforeAll,\n beforeEach,\n describe,\n expect,\n it,\n} from \"vitest\";\n\nconst runtime: ExecutorRuntime = {\n suite: describe as ExecutorRuntime[\"suite\"],\n test: it as ExecutorRuntime[\"test\"],\n beforeAll,\n afterAll,\n beforeEach,\n afterEach,\n currentTestName: () => expect.getState().currentTestName,\n retry: (count: number) => {\n const retry = (it as typeof it & { retry?: (attempts: number) => void }).retry;\n if (typeof retry === \"function\") {\n retry(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 };\n"]}
@@ -0,0 +1,13 @@
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;
package/dist/index.js ADDED
@@ -0,0 +1,38 @@
1
+ import { registerFeaturePlan } from '@autometa/executor';
2
+ import { describe, it, beforeAll, afterAll, beforeEach, afterEach, expect } from 'vitest';
3
+
4
+ // src/index.ts
5
+ var runtime = {
6
+ suite: describe,
7
+ test: it,
8
+ beforeAll,
9
+ afterAll,
10
+ beforeEach,
11
+ afterEach,
12
+ currentTestName: () => expect.getState().currentTestName,
13
+ retry: (count) => {
14
+ const retry = it.retry;
15
+ if (typeof retry === "function") {
16
+ retry(count);
17
+ }
18
+ },
19
+ warn: (message) => {
20
+ console.warn(message);
21
+ },
22
+ logError: (error) => {
23
+ console.error(error);
24
+ }
25
+ };
26
+ function execute(options) {
27
+ registerFeaturePlan({
28
+ plan: options.plan,
29
+ adapter: options.adapter,
30
+ config: options.config,
31
+ runtime
32
+ });
33
+ }
34
+ var src_default = { execute };
35
+
36
+ export { src_default as default, execute };
37
+ //# sourceMappingURL=out.js.map
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";AAKA,SAAS,2BAA2B;AACpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,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,UAAM,QAAS,GAA0D;AACzE,QAAI,OAAO,UAAU,YAAY;AAC/B,YAAM,KAAK;AAAA,IACb;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\";\nimport {\n afterAll,\n afterEach,\n beforeAll,\n beforeEach,\n describe,\n expect,\n it,\n} from \"vitest\";\n\nconst runtime: ExecutorRuntime = {\n suite: describe as ExecutorRuntime[\"suite\"],\n test: it as ExecutorRuntime[\"test\"],\n beforeAll,\n afterAll,\n beforeEach,\n afterEach,\n currentTestName: () => expect.getState().currentTestName,\n retry: (count: number) => {\n const retry = (it as typeof it & { retry?: (attempts: number) => void }).retry;\n if (typeof retry === \"function\") {\n retry(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 };\n"]}
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@autometa/vitest-executor",
3
+ "version": "1.0.0-rc.0",
4
+ "description": "",
5
+ "type": "module",
6
+ "main": "dist/index.cjs",
7
+ "module": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "exports": {
13
+ "import": "./dist/index.js",
14
+ "require": "./dist/index.cjs",
15
+ "default": "./dist/index.js",
16
+ "types": "./dist/index.d.ts"
17
+ },
18
+ "license": "MIT",
19
+ "dependencies": {
20
+ "@autometa/config": "1.0.0-rc.0",
21
+ "@autometa/executor": "1.0.0-rc.0",
22
+ "@autometa/test-builder": "1.0.0-rc.0",
23
+ "@autometa/scopes": "1.0.0-rc.0"
24
+ },
25
+ "devDependencies": {
26
+ "@types/node": "^18.11.18",
27
+ "@typescript-eslint/eslint-plugin": "^5.54.1",
28
+ "@typescript-eslint/parser": "^5.54.1",
29
+ "eslint": "^8.37.0",
30
+ "eslint-config-prettier": "^8.3.0",
31
+ "rimraf": "^4.1.2",
32
+ "tsup": "^7.2.0",
33
+ "typescript": "^4.9.5",
34
+ "vitest": "1.4.0",
35
+ "eslint-config-custom": "0.6.0",
36
+ "tsconfig": "0.7.0",
37
+ "tsup-config": "0.1.0",
38
+ "@autometa/gherkin": "1.0.0-rc.0"
39
+ },
40
+ "scripts": {
41
+ "type-check": "tsc --noEmit -p tsconfig.dev.json",
42
+ "type-check:watch": "tsc --noEmit --watch -p tsconfig.dev.json",
43
+ "build": "tsup && pnpm run build:types",
44
+ "build:types": "rimraf tsconfig.types.tsbuildinfo && tsc --build tsconfig.types.json",
45
+ "build:watch": "tsup --watch",
46
+ "dev": "tsup --watch",
47
+ "test": "vitest run --passWithNoTests",
48
+ "test:watch": "vitest --passWithNoTests",
49
+ "test:ui": "vitest --ui --passWithNoTests",
50
+ "test:integration": "vitest run --config vitest.integration.config.ts",
51
+ "coverage": "vitest run --coverage --passWithNoTests",
52
+ "lint": "eslint . --max-warnings 0",
53
+ "lint:fix": "eslint . --fix",
54
+ "prettify": "prettier --config .prettierrc 'src/**/*.ts' --write",
55
+ "clean": "rimraf dist"
56
+ }
57
+ }