@japa/runner 2.5.1 → 3.0.0-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.md +1 -1
- package/build/index.d.ts +8 -29
- package/build/index.js +93 -466
- package/build/src/cli_parser.d.ts +6 -0
- package/build/src/cli_parser.d.ts.map +1 -0
- package/build/src/cli_parser.js +49 -0
- package/build/src/config_manager.d.ts +7 -0
- package/build/src/config_manager.d.ts.map +1 -0
- package/build/src/config_manager.js +115 -0
- package/build/src/create_test.d.ts +16 -0
- package/build/src/create_test.d.ts.map +1 -0
- package/build/src/create_test.js +33 -0
- package/build/src/debug.d.ts +2 -1
- package/build/src/debug.d.ts.map +1 -0
- package/build/src/debug.js +2 -12
- package/build/src/exceptions_manager.d.ts +7 -0
- package/build/src/exceptions_manager.d.ts.map +1 -0
- package/build/src/exceptions_manager.js +58 -0
- package/build/src/files_manager.d.ts +7 -0
- package/build/src/files_manager.d.ts.map +1 -0
- package/build/src/files_manager.js +28 -0
- package/build/src/helpers.d.ts +23 -0
- package/build/src/helpers.d.ts.map +1 -0
- package/build/src/helpers.js +2 -0
- package/build/src/hooks.d.ts +9 -0
- package/build/src/hooks.d.ts.map +1 -0
- package/build/src/hooks.js +26 -0
- package/build/src/planner.d.ts +18 -0
- package/build/src/planner.d.ts.map +1 -0
- package/build/src/planner.js +67 -0
- package/build/src/plugins/retry.d.ts +8 -0
- package/build/src/plugins/retry.d.ts.map +1 -0
- package/build/src/plugins/retry.js +42 -0
- package/build/src/reporters/dot.d.ts +7 -0
- package/build/src/reporters/dot.d.ts.map +1 -0
- package/build/src/reporters/dot.js +24 -0
- package/build/src/reporters/main.d.ts +5 -0
- package/build/src/reporters/main.d.ts.map +1 -0
- package/build/src/reporters/main.js +21 -0
- package/build/src/reporters/ndjson.d.ts +12 -0
- package/build/src/reporters/ndjson.d.ts.map +1 -0
- package/build/src/reporters/ndjson.js +61 -0
- package/build/src/reporters/spec.d.ts +11 -0
- package/build/src/reporters/spec.d.ts.map +1 -0
- package/build/src/reporters/spec.js +103 -0
- package/build/src/types.d.ts +48 -49
- package/build/src/types.d.ts.map +1 -0
- package/build/src/types.js +1 -10
- package/build/src/validator.d.ts +11 -0
- package/build/src/validator.d.ts.map +1 -0
- package/build/src/validator.js +46 -0
- package/package.json +76 -83
- package/build/src/core/main.d.ts +0 -49
- package/build/src/core/main.js +0 -87
package/build/src/core/main.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { DataSetNode, Test as BaseTest, Group as BaseGroup, Suite as BaseSuite, Runner as BaseRunner, TestHooksCleanupHandler, TestContext as BaseTestContext } from '@japa/core';
|
|
2
|
-
/**
|
|
3
|
-
* Runner specific test context. Here we extend the test context to register
|
|
4
|
-
* cleanup methods with the test and register hooks to get notified when
|
|
5
|
-
* a new instance of test context is created.
|
|
6
|
-
*/
|
|
7
|
-
export declare class TestContext extends BaseTestContext {
|
|
8
|
-
test: Test;
|
|
9
|
-
/**
|
|
10
|
-
* Methods to call after the test context instance
|
|
11
|
-
* is created
|
|
12
|
-
*/
|
|
13
|
-
static createdCallbacks: ((context: TestContext) => void)[];
|
|
14
|
-
/**
|
|
15
|
-
* Register a function to get notified when an instance of test
|
|
16
|
-
* context is created. The callback must be synchronous
|
|
17
|
-
*/
|
|
18
|
-
static created(callback: (context: TestContext) => void): typeof TestContext;
|
|
19
|
-
/**
|
|
20
|
-
* Register a cleanup function. Cleanup functions are called after
|
|
21
|
-
* the test finishes
|
|
22
|
-
*/
|
|
23
|
-
cleanup: (handler: TestHooksCleanupHandler<this>) => void;
|
|
24
|
-
constructor(test: Test);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Runner specific Test with a fixed TestContext static type.
|
|
28
|
-
*/
|
|
29
|
-
export declare class Test<TestData extends DataSetNode = undefined> extends BaseTest<TestContext, TestData> {
|
|
30
|
-
static disposeCallbacks: never[];
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Runner specific Group with a fixed TestContext static type.
|
|
34
|
-
*/
|
|
35
|
-
export declare class Group extends BaseGroup<TestContext> {
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Runner specific Suite with a fixed TestContext static type.
|
|
39
|
-
*/
|
|
40
|
-
export declare class Suite extends BaseSuite<TestContext> {
|
|
41
|
-
onGroup(callback: (group: Group) => void): this;
|
|
42
|
-
onTest(callback: (test: Test<any>) => void): this;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Runner specific tests Runner with a fixed TestContext static type.
|
|
46
|
-
*/
|
|
47
|
-
export declare class Runner extends BaseRunner<TestContext> {
|
|
48
|
-
onSuite(callback: (suite: Suite) => void): this;
|
|
49
|
-
}
|
package/build/src/core/main.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* @japa/runner
|
|
4
|
-
*
|
|
5
|
-
* (c) Japa.dev
|
|
6
|
-
*
|
|
7
|
-
* For the full copyright and license information, please view the LICENSE
|
|
8
|
-
* file that was distributed with this source code.
|
|
9
|
-
*/
|
|
10
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.Runner = exports.Suite = exports.Group = exports.Test = exports.TestContext = void 0;
|
|
15
|
-
const core_1 = require("@japa/core");
|
|
16
|
-
const debug_1 = __importDefault(require("../debug"));
|
|
17
|
-
/**
|
|
18
|
-
* Runner specific test context. Here we extend the test context to register
|
|
19
|
-
* cleanup methods with the test and register hooks to get notified when
|
|
20
|
-
* a new instance of test context is created.
|
|
21
|
-
*/
|
|
22
|
-
class TestContext extends core_1.TestContext {
|
|
23
|
-
/**
|
|
24
|
-
* Register a function to get notified when an instance of test
|
|
25
|
-
* context is created. The callback must be synchronous
|
|
26
|
-
*/
|
|
27
|
-
static created(callback) {
|
|
28
|
-
(0, debug_1.default)('registering test context created hook "%s"', callback);
|
|
29
|
-
this.createdCallbacks.push(callback);
|
|
30
|
-
return this;
|
|
31
|
-
}
|
|
32
|
-
constructor(test) {
|
|
33
|
-
super();
|
|
34
|
-
this.test = test;
|
|
35
|
-
this.cleanup = (handler) => {
|
|
36
|
-
test.cleanup(handler);
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Invoke ready callbacks
|
|
40
|
-
*/
|
|
41
|
-
const Constructor = this.constructor;
|
|
42
|
-
Constructor.createdCallbacks.forEach((callback) => callback(this));
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.TestContext = TestContext;
|
|
46
|
-
/**
|
|
47
|
-
* Methods to call after the test context instance
|
|
48
|
-
* is created
|
|
49
|
-
*/
|
|
50
|
-
TestContext.createdCallbacks = [];
|
|
51
|
-
/**
|
|
52
|
-
* Runner specific Test with a fixed TestContext static type.
|
|
53
|
-
*/
|
|
54
|
-
class Test extends core_1.Test {
|
|
55
|
-
}
|
|
56
|
-
exports.Test = Test;
|
|
57
|
-
Test.disposeCallbacks = [];
|
|
58
|
-
/**
|
|
59
|
-
* Runner specific Group with a fixed TestContext static type.
|
|
60
|
-
*/
|
|
61
|
-
class Group extends core_1.Group {
|
|
62
|
-
}
|
|
63
|
-
exports.Group = Group;
|
|
64
|
-
/**
|
|
65
|
-
* Runner specific Suite with a fixed TestContext static type.
|
|
66
|
-
*/
|
|
67
|
-
class Suite extends core_1.Suite {
|
|
68
|
-
onGroup(callback) {
|
|
69
|
-
super.onGroup(callback);
|
|
70
|
-
return this;
|
|
71
|
-
}
|
|
72
|
-
onTest(callback) {
|
|
73
|
-
super.onTest(callback);
|
|
74
|
-
return this;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
exports.Suite = Suite;
|
|
78
|
-
/**
|
|
79
|
-
* Runner specific tests Runner with a fixed TestContext static type.
|
|
80
|
-
*/
|
|
81
|
-
class Runner extends core_1.Runner {
|
|
82
|
-
onSuite(callback) {
|
|
83
|
-
super.onSuite(callback);
|
|
84
|
-
return this;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
exports.Runner = Runner;
|