@wocker/testing 1.0.2 → 1.0.3-beta.1
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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@wocker/testing)
|
|
6
6
|
[](https://github.com/kearisp/wocker-testing/actions/workflows/publish-latest.yml)
|
|
7
|
-
[](https://github.com/kearisp/wocker-testing/blob/
|
|
7
|
+
[](https://github.com/kearisp/wocker-testing/blob/master/LICENSE)
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/@wocker/testing)
|
|
10
10
|
[](https://bundlephobia.com/package/@wocker/testing)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApplicationContext, InjectionToken, ProviderType, Type, ModuleMetadata } from "@wocker/core";
|
|
2
2
|
export declare class TestingModuleBuilder {
|
|
3
|
-
protected readonly moduleType:
|
|
3
|
+
protected readonly moduleType: Type;
|
|
4
4
|
protected readonly overrideProviders: Map<InjectionToken, ProviderType>;
|
|
5
5
|
constructor(metadata: ModuleMetadata);
|
|
6
6
|
protected createModule(metadata: ModuleMetadata): {
|
|
@@ -8,10 +8,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.TestingModuleBuilder = void 0;
|
|
10
10
|
const core_1 = require("@wocker/core");
|
|
11
|
+
const services_1 = require("../services");
|
|
11
12
|
class TestingModuleBuilder {
|
|
12
13
|
constructor(metadata) {
|
|
13
14
|
this.moduleType = this.createModule(metadata);
|
|
14
15
|
this.overrideProviders = new Map();
|
|
16
|
+
this.overrideProvider(core_1.ProcessService)
|
|
17
|
+
.useProvider(services_1.MockProcessService);
|
|
15
18
|
}
|
|
16
19
|
createModule(metadata) {
|
|
17
20
|
let TestingModule = class TestingModule {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ProcessService } from "@wocker/core";
|
|
1
|
+
import { ProcessService, FileSystemDriver } from "@wocker/core";
|
|
2
2
|
export declare class MockProcessService extends ProcessService {
|
|
3
|
+
protected readonly driver: FileSystemDriver;
|
|
3
4
|
protected _pwd: string;
|
|
4
|
-
constructor(dataDir: string);
|
|
5
|
+
constructor(dataDir: string, driver: FileSystemDriver);
|
|
5
6
|
pwd(path?: string): string;
|
|
6
7
|
chdir(path: string): void;
|
|
7
8
|
}
|
|
@@ -17,18 +17,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.MockProcessService = void 0;
|
|
19
19
|
const core_1 = require("@wocker/core");
|
|
20
|
-
const fs_1 = __importDefault(require("fs"));
|
|
21
20
|
const path_1 = __importDefault(require("path"));
|
|
22
21
|
let MockProcessService = class MockProcessService extends core_1.ProcessService {
|
|
23
|
-
constructor(dataDir) {
|
|
22
|
+
constructor(dataDir, driver) {
|
|
24
23
|
super();
|
|
24
|
+
this.driver = driver;
|
|
25
25
|
this._pwd = dataDir;
|
|
26
26
|
}
|
|
27
27
|
pwd(path = "") {
|
|
28
28
|
return path_1.default.join(this._pwd, path);
|
|
29
29
|
}
|
|
30
30
|
chdir(path) {
|
|
31
|
-
if (!
|
|
31
|
+
if (!this.driver.existsSync(path)) {
|
|
32
32
|
throw new Error(`ENOENT: no such file or directory, chdir '${this._pwd}' -> '${path}'`);
|
|
33
33
|
}
|
|
34
34
|
this._pwd = path;
|
|
@@ -36,7 +36,8 @@ let MockProcessService = class MockProcessService extends core_1.ProcessService
|
|
|
36
36
|
};
|
|
37
37
|
exports.MockProcessService = MockProcessService;
|
|
38
38
|
exports.MockProcessService = MockProcessService = __decorate([
|
|
39
|
-
(0, core_1.Injectable)(),
|
|
39
|
+
(0, core_1.Injectable)("CORE_PROCESS_SERVICE"),
|
|
40
40
|
__param(0, (0, core_1.Inject)(core_1.WOCKER_DATA_DIR_KEY)),
|
|
41
|
-
|
|
41
|
+
__param(1, (0, core_1.Inject)(core_1.FILE_SYSTEM_DRIVER_KEY)),
|
|
42
|
+
__metadata("design:paramtypes", [String, Object])
|
|
42
43
|
], MockProcessService);
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wocker/testing",
|
|
3
|
-
"
|
|
3
|
+
"type": "commonjs",
|
|
4
|
+
"version": "1.0.3-beta.1",
|
|
4
5
|
"author": "Kris Papercut <krispcut@gmail.com>",
|
|
5
6
|
"description": "Docker workspace for web projects (testing)",
|
|
6
7
|
"license": "MIT",
|
|
@@ -29,21 +30,21 @@
|
|
|
29
30
|
"make-coverage-badge": "make-coverage-badge"
|
|
30
31
|
},
|
|
31
32
|
"peerDependencies": {
|
|
32
|
-
"@wocker/core": "^1.0.
|
|
33
|
+
"@wocker/core": "^1.0.26",
|
|
33
34
|
"docker-modem": "^5.0.6",
|
|
34
35
|
"dockerode": "^4.0.7"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
|
-
"@types/jest": "^
|
|
38
|
-
"@wocker/core": "^1.0.
|
|
38
|
+
"@types/jest": "^30.0.0",
|
|
39
|
+
"@wocker/core": "^1.0.26",
|
|
39
40
|
"docker-modem": "*",
|
|
40
41
|
"dockerode": "*",
|
|
41
|
-
"jest": "^
|
|
42
|
+
"jest": "^30.1.3",
|
|
42
43
|
"make-coverage-badge": "^1.2.0",
|
|
43
44
|
"memfs": "^4.17.2",
|
|
44
|
-
"ts-jest": "^29.
|
|
45
|
+
"ts-jest": "^29.4.4",
|
|
45
46
|
"ts-node": "^10.9.2",
|
|
46
|
-
"typescript": "^5.
|
|
47
|
+
"typescript": "^5.9.2",
|
|
47
48
|
"unionfs": "^4.5.4"
|
|
48
49
|
}
|
|
49
50
|
}
|