|
4 | 4 | import yok = require('../lib/common/yok');
|
5 | 5 | import stubs = require('./stubs');
|
6 | 6 | import * as constants from "./../lib/constants";
|
7 |
| -import {ChildProcess} from "../lib/common/child-process"; |
| 7 | +import * as ChildProcessLib from "../lib/common/child-process"; |
8 | 8 | import * as ProjectServiceLib from "../lib/services/project-service";
|
9 | 9 | import * as ProjectDataServiceLib from "../lib/services/project-data-service";
|
10 | 10 | import * as ProjectDataLib from "../lib/project-data";
|
11 | 11 | import * as ProjectHelperLib from "../lib/common/project-helper";
|
12 |
| -import {StaticConfig} from "../lib/config"; |
| 12 | +import * as ConfigLib from "../lib/config"; |
13 | 13 | import * as NpmLib from "../lib/node-package-manager";
|
14 | 14 | import {NpmInstallationManager} from "../lib/npm-installation-manager";
|
15 | 15 | import * as HttpClientLib from "../lib/common/http-client";
|
16 |
| -import {FileSystem} from "../lib/common/file-system"; |
| 16 | +import * as FileSystemLib from "../lib/common/file-system"; |
17 | 17 | import * as path from "path";
|
18 | 18 | import temp = require("temp");
|
19 | 19 | import * as helpers from "../lib/common/helpers";
|
20 | 20 | import {assert} from "chai";
|
21 |
| -import {Options} from "../lib/options"; |
22 |
| -import {HostInfo} from "../lib/common/host-info"; |
23 |
| -import {IOSProjectService} from "../lib/services/ios-project-service"; |
| 21 | +import * as OptionsLib from "../lib/options"; |
| 22 | +import * as HostInfoLib from "../lib/common/host-info"; |
| 23 | +import * as iOSProjectServiceLib from "../lib/services/ios-project-service"; |
24 | 24 | import * as shell from "shelljs";
|
| 25 | +import ErrorsLib = require("../lib/common/errors"); |
| 26 | + |
25 | 27 |
|
26 | 28 | let mockProjectNameValidator = {
|
27 | 29 | validate: () => { return true; }
|
@@ -104,25 +106,25 @@ class ProjectIntegrationTest {
|
104 | 106 |
|
105 | 107 | private createTestInjector(): void {
|
106 | 108 | this.testInjector = new yok.Yok();
|
107 |
| - this.testInjector.register("childProcess", ChildProcess); |
| 109 | + this.testInjector.register("childProcess", ChildProcessLib.ChildProcess); |
108 | 110 | this.testInjector.register("errors", stubs.ErrorsStub);
|
109 | 111 | this.testInjector.register('logger', stubs.LoggerStub);
|
110 | 112 | this.testInjector.register("projectService", ProjectServiceLib.ProjectService);
|
111 | 113 | this.testInjector.register("projectHelper", ProjectHelperLib.ProjectHelper);
|
112 | 114 | this.testInjector.register("projectTemplatesService", stubs.ProjectTemplatesService);
|
113 | 115 | this.testInjector.register("projectNameValidator", mockProjectNameValidator);
|
114 | 116 |
|
115 |
| - this.testInjector.register("fs", FileSystem); |
| 117 | + this.testInjector.register("fs", FileSystemLib.FileSystem); |
116 | 118 | this.testInjector.register("projectDataService", ProjectDataServiceLib.ProjectDataService);
|
117 |
| - this.testInjector.register("staticConfig", StaticConfig); |
| 119 | + this.testInjector.register("staticConfig", ConfigLib.StaticConfig); |
118 | 120 |
|
119 | 121 | this.testInjector.register("npmInstallationManager", NpmInstallationManager);
|
120 | 122 | this.testInjector.register("npm", NpmLib.NodePackageManager);
|
121 | 123 | this.testInjector.register("httpClient", HttpClientLib.HttpClient);
|
122 | 124 | this.testInjector.register("lockfile", stubs.LockFile);
|
123 | 125 |
|
124 |
| - this.testInjector.register("options", Options); |
125 |
| - this.testInjector.register("hostInfo", HostInfo); |
| 126 | + this.testInjector.register("options", OptionsLib.Options); |
| 127 | + this.testInjector.register("hostInfo", HostInfoLib.HostInfo); |
126 | 128 | }
|
127 | 129 | }
|
128 | 130 |
|
@@ -204,51 +206,44 @@ function createTestInjector() {
|
204 | 206 | testInjector.register("projectHelper", ProjectHelperLib.ProjectHelper);
|
205 | 207 | testInjector.register("projectTemplatesService", stubs.ProjectTemplatesService);
|
206 | 208 | testInjector.register("projectNameValidator", mockProjectNameValidator);
|
207 |
| - |
208 |
| - testInjector.register("fs", FileSystem); |
| 209 | + testInjector.register("fs", FileSystemLib.FileSystem); |
209 | 210 | testInjector.register("projectDataService", ProjectDataServiceLib.ProjectDataService);
|
210 |
| - |
211 |
| - testInjector.register("staticConfig", StaticConfig); |
212 |
| - |
| 211 | + testInjector.register("staticConfig", ConfigLib.StaticConfig); |
213 | 212 | testInjector.register("npmInstallationManager", NpmInstallationManager);
|
214 | 213 | testInjector.register("httpClient", HttpClientLib.HttpClient);
|
215 | 214 | testInjector.register("lockfile", stubs.LockFile);
|
216 |
| - |
217 |
| - testInjector.register("childProcess", ChildProcess); |
218 |
| - |
| 215 | + testInjector.register("childProcess", ChildProcessLib.ChildProcess); |
219 | 216 | testInjector.register('projectData', ProjectDataLib.ProjectData);
|
220 |
| - testInjector.register("options", Options); |
221 |
| - testInjector.register("hostInfo", HostInfo); |
| 217 | + testInjector.register("options", OptionsLib.Options); |
| 218 | + testInjector.register("hostInfo", HostInfoLib.HostInfo); |
222 | 219 |
|
223 | 220 | return testInjector;
|
224 | 221 | }
|
225 | 222 |
|
226 | 223 | function createInjectorForPodsTest() {
|
227 | 224 | let testInjector = new yok.Yok();
|
228 |
| - |
229 |
| - testInjector.register("errors", stubs.ErrorsStub); |
230 |
| - testInjector.register('logger', stubs.LoggerStub); |
231 |
| - testInjector.register("projectHelper", {}); |
| 225 | + testInjector.register("childProcess", ChildProcessLib.ChildProcess); |
| 226 | + testInjector.register("config", ConfigLib.Configuration); |
| 227 | + testInjector.register("errors", ErrorsLib.Errors); |
| 228 | + testInjector.register("fs", FileSystemLib.FileSystem); |
| 229 | + testInjector.register("hostInfo", HostInfoLib.HostInfo); |
| 230 | + testInjector.register("injector", testInjector); |
| 231 | + testInjector.register("iOSEmulatorServices", {}); |
| 232 | + testInjector.register("iOSProjectService", iOSProjectServiceLib.IOSProjectService); |
| 233 | + testInjector.register("options", OptionsLib.Options); |
232 | 234 | testInjector.register("projectData", {
|
233 | 235 | projectName: "__PROJECT_NAME__",
|
234 | 236 | platformsDir: ""
|
235 | 237 | });
|
| 238 | + testInjector.register("projectHelper", {}); |
| 239 | + testInjector.register("staticConfig", ConfigLib.StaticConfig); |
236 | 240 | testInjector.register("projectDataService", {});
|
237 |
| - testInjector.register("iOSEmulatorServices", {}); |
| 241 | + testInjector.register("prompter", {}); |
| 242 | + testInjector.register('logger', stubs.LoggerStub); |
238 | 243 | testInjector.register("config", {
|
239 | 244 | "USE_POD_SANDBOX": true
|
240 | 245 | });
|
241 |
| - testInjector.register("prompter", {}); |
242 |
| - testInjector.register("fs", FileSystem); |
243 |
| - testInjector.register("staticConfig", StaticConfig); |
244 | 246 | testInjector.register("npmInstallationManager", NpmInstallationManager);
|
245 |
| - testInjector.register("iOSProjectService", IOSProjectService); |
246 |
| - testInjector.register("projectService", ProjectServiceLib.ProjectService); |
247 |
| - testInjector.register("projectTemplatesService", stubs.ProjectTemplatesService); |
248 |
| - testInjector.register("projectNameValidator", mockProjectNameValidator); |
249 |
| - testInjector.register("options", Options); |
250 |
| - testInjector.register("hostInfo", HostInfo); |
251 |
| - testInjector.register("childProcess", ChildProcess); |
252 | 247 |
|
253 | 248 | return testInjector;
|
254 | 249 | }
|
|
0 commit comments