Skip to content

Commit 8d88613

Browse files
committed
Update TS to latest release
Fix correcponding tests
1 parent 7f9c201 commit 8d88613

19 files changed

+33
-38
lines changed

lib/constants.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class LiveSyncPaths {
7979
static FULLSYNC_DIR_NAME = "fullsync";
8080
static IOS_DEVICE_PROJECT_ROOT_PATH = "Library/Application Support/LiveSync";
8181
static IOS_DEVICE_SYNC_ZIP_PATH = "Library/Application Support/LiveSync/sync.zip";
82-
};
82+
}
8383
export const ANGULAR_NAME = "angular";
8484
export const TYPESCRIPT_NAME = "typescript";
8585
export const BUILD_OUTPUT_EVENT_NAME = "buildOutput";

lib/services/android-project-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export class AndroidProjectService extends projectServiceBaseLib.PlatformProject
171171
this.$errors.failWithoutHelp(`Your project have installed ${dependency.name} version ${cleanedVerson} but Android platform requires version ${dependency.version}.`);
172172
}
173173
}
174-
};
174+
}
175175
}
176176

177177
private cleanResValues(targetSdkVersion: number, projectData: IProjectData, frameworkVersion: string): void {

lib/services/init-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class InitService implements IInitService {
5656

5757
projectData[this.$staticConfig.CLIENT_NAME_KEY_IN_PROJECT_FILE][platformData.frameworkPackageName] = _.extend(currentPlatformData, await this.getVersionData(platformData.frameworkPackageName));
5858
}
59-
};
59+
}
6060
}
6161

6262
let dependencies = projectData.dependencies;

lib/services/ios-project-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ We will now place an empty obsolete compatability white screen LauncScreen.xib f
933933
private getAllLibsForPluginWithFileExtension(pluginData: IPluginData, fileExtension: string): string[] {
934934
let filterCallback = (fileName: string, pluginPlatformsFolderPath: string) => path.extname(fileName) === fileExtension;
935935
return this.getAllNativeLibrariesForPlugin(pluginData, IOSProjectService.IOS_PLATFORM_NAME, filterCallback);
936-
};
936+
}
937937

938938
private buildPathToCurrentXcodeProjectFile(projectData: IProjectData): string {
939939
return path.join(projectData.platformsDir, "ios", `${projectData.projectName}.xcodeproj`, "project.pbxproj");

lib/services/platform-service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class PlatformService extends EventEmitter implements IPlatformService {
7373
let version: string;
7474
if (currentPlatformData && currentPlatformData[constants.VERSION_STRING]) {
7575
version = currentPlatformData[constants.VERSION_STRING];
76-
};
76+
}
7777

7878
return version;
7979
}
@@ -669,7 +669,7 @@ export class PlatformService extends EventEmitter implements IPlatformService {
669669
} else {
670670
await this.addPlatform(platformParam, platformTemplate, projectData, config);
671671
}
672-
};
672+
}
673673
}
674674

675675
private getCanExecuteAction(platform: string, options: IDeviceEmulator): any {

lib/services/plugins-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export class PluginsService implements IPluginsService {
280280
let pluginDestinationPath = path.join(platformData.appDestinationDirectoryPath, constants.APP_FOLDER_NAME, "tns_modules");
281281
await action(pluginDestinationPath, platform.toLowerCase(), platformData);
282282
}
283-
};
283+
}
284284
}
285285

286286
private getInstalledFrameworkVersion(platform: string, projectData: IProjectData): string {

lib/services/xcconfig-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export class XCConfigService {
44

55
/**
66
* Returns the Value of a Property from a XC Config file.
7-
* @param xcconfigFilePath
7+
* @param xcconfigFilePath
88
* @param propertyName
99
*/
1010
public readPropertyValue(xcconfigFilePath: string, propertyName: string): string {

package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
"@types/chai": "3.4.34",
8585
"@types/chai-as-promised": "0.0.29",
8686
"@types/chokidar": "1.6.0",
87-
"@types/lodash": "4.14.50",
8887
"@types/node": "6.0.61",
8988
"@types/qr-image": "3.2.0",
9089
"@types/request": "0.0.42",
@@ -97,14 +96,14 @@
9796
"grunt-contrib-copy": "1.0.0",
9897
"grunt-contrib-watch": "1.0.0",
9998
"grunt-shell": "1.3.0",
100-
"grunt-ts": "6.0.0-beta.6",
101-
"grunt-tslint": "4.0.0",
99+
"grunt-ts": "6.0.0-beta.16",
100+
"grunt-tslint": "5.0.1",
102101
"istanbul": "0.4.5",
103102
"mocha": "3.1.2",
104103
"should": "7.0.2",
105104
"source-map-support": "^0.4.14",
106-
"tslint": "4.3.1",
107-
"typescript": "2.1.4"
105+
"tslint": "5.4.3",
106+
"typescript": "2.3.4"
108107
},
109108
"license": "Apache-2.0",
110109
"engines": {

test/ios-entitlements-service.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe("IOSEntitlements Service Tests", () => {
2929
testInjector.register("errors", ErrorsLib.Errors);
3030

3131
testInjector.register("pluginsService", {
32-
getAllInstalledPlugins: async () => []
32+
getAllInstalledPlugins: async (): Promise<any[]> => []
3333
});
3434

3535
return testInjector;
@@ -137,8 +137,8 @@ describe("IOSEntitlements Service Tests", () => {
137137

138138
it("Merge uses the entitlements file from a Plugin", async () => {
139139
let pluginsService = injector.resolve("pluginsService");
140-
let testPluginFolderPath = temp.mkdirSync("testPlugin");
141-
pluginsService.getAllInstalledPlugins = async() => [{
140+
let testPluginFolderPath = temp.mkdirSync("testPlugin");
141+
pluginsService.getAllInstalledPlugins = async () => [{
142142
pluginPlatformsFolderPath: (platform: string) => {
143143
return testPluginFolderPath;
144144
}
@@ -161,8 +161,8 @@ describe("IOSEntitlements Service Tests", () => {
161161

162162
// setup plugin entitlements
163163
let pluginsService = injector.resolve("pluginsService");
164-
let testPluginFolderPath = temp.mkdirSync("testPlugin");
165-
pluginsService.getAllInstalledPlugins = async() => [{
164+
let testPluginFolderPath = temp.mkdirSync("testPlugin");
165+
pluginsService.getAllInstalledPlugins = async () => [{
166166
pluginPlatformsFolderPath: (platform: string) => {
167167
return testPluginFolderPath;
168168
}

test/platform-commands.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class PlatformData implements IPlatformData {
3535
emulatorServices: Mobile.IEmulatorPlatformServices = null;
3636
projectRoot = "";
3737
deviceBuildOutputPath = "";
38-
getValidPackageNames = (buildOptions: {isForDevice?: boolean, isReleaseBuild?: boolean}) => [""];
38+
getValidPackageNames = (buildOptions: { isForDevice?: boolean, isReleaseBuild?: boolean }) => [""];
3939
validPackageNamesForDevice: string[] = [];
4040
frameworkFilesExtensions = [".jar", ".dat"];
4141
appDestinationDirectoryPath = "";
@@ -126,7 +126,7 @@ function createTestInjector() {
126126
prepareNodeModulesFolder: () => { /* intentionally left blank */ }
127127
});
128128
testInjector.register("pluginsService", {
129-
getAllInstalledPlugins: async () => []
129+
getAllInstalledPlugins: async (): Promise<any[]> => []
130130
});
131131
testInjector.register("projectFilesManager", ProjectFilesManagerLib.ProjectFilesManager);
132132
testInjector.register("hooksService", stubs.HooksServiceStub);
@@ -143,7 +143,7 @@ function createTestInjector() {
143143
testInjector.register("projectChangesService", ProjectChangesLib.ProjectChangesService);
144144
testInjector.register("emulatorPlatformService", stubs.EmulatorPlatformService);
145145
testInjector.register("analyticsService", {
146-
track: async () => undefined
146+
track: async () => async (): Promise<any[]> => undefined
147147
});
148148
testInjector.register("messages", Messages);
149149
testInjector.register("devicePathProvider", {});

test/platform-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function createTestInjector() {
8181
testInjector.register("projectChangesService", ProjectChangesLib.ProjectChangesService);
8282
testInjector.register("emulatorPlatformService", stubs.EmulatorPlatformService);
8383
testInjector.register("analyticsService", {
84-
track: async () => undefined
84+
track: async (): Promise<any[]> => undefined
8585
});
8686
testInjector.register("messages", Messages);
8787
testInjector.register("devicePathProvider", {});

test/project-templates-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function createTestInjector(configuration?: { shouldNpmInstallThrow: boolean, np
5050

5151
injector.register("projectTemplatesService", ProjectTemplatesService);
5252

53-
injector.register("analyticsService", { track: async () => undefined });
53+
injector.register("analyticsService", { track: async (): Promise<any[]> => undefined });
5454

5555
return injector;
5656
}

test/services/debug-service.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class PlatformDebugService extends EventEmitter /* implements IPlatformDebugServ
1111
public async debug(debugData: IDebugData, debugOptions: IDebugOptions): Promise<string[]> {
1212
return [fakeChromeDebugUrl];
1313
}
14-
};
14+
}
1515

1616
interface IDebugTestDeviceInfo {
1717
deviceInfo: {
@@ -20,7 +20,7 @@ interface IDebugTestDeviceInfo {
2020
};
2121

2222
isEmulator: boolean;
23-
};
23+
}
2424

2525
interface IDebugTestData {
2626
isDeviceFound: boolean;
@@ -30,7 +30,7 @@ interface IDebugTestData {
3030
isWindows: boolean;
3131
isDarwin: boolean;
3232
};
33-
};
33+
}
3434

3535
const getDefaultDeviceInformation = (platform?: string): IDebugTestDeviceInfo => ({
3636
deviceInfo: {

test/services/extensibility-service.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ describe("extensibilityService", () => {
251251
assert.deepEqual(err.message, expectedResults[index].message);
252252
assert.deepEqual(err.extensionName, extensionNames[index]);
253253
});
254-
};
254+
}
255255
});
256256

257257
it("rejects all promises when unable to read node_modules dir (simulate EPERM error)", async () => {
@@ -287,7 +287,7 @@ describe("extensibilityService", () => {
287287
assert.deepEqual(err.message, `Unable to load extension ${extensionName}. You will not be able to use the functionality that it adds. Error: ${expectedErrorMessage}`);
288288
assert.deepEqual(err.extensionName, extensionName);
289289
});
290-
};
290+
}
291291

292292
assert.deepEqual(promises.length, extensionNames.length);
293293
assert.isTrue(isReadDirCalled, "readDirectory should have been called for the extensions.");
@@ -340,7 +340,7 @@ describe("extensibilityService", () => {
340340
assert.deepEqual(err.message, `Unable to load extension ${extensionName}. You will not be able to use the functionality that it adds. Error: ${expectedErrorMessages[index]}`);
341341
assert.deepEqual(err.extensionName, extensionName);
342342
});
343-
};
343+
}
344344

345345
assert.deepEqual(promises.length, extensionNames.length);
346346
assert.isTrue(isNpmInstallCalled, "Npm install should have been called for the extensions.");

test/services/subscription-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface IValidateTestData {
99
name: string;
1010
valuePassedToValidate: string;
1111
expectedResult: boolean | string;
12-
};
12+
}
1313

1414
const createTestInjector = (): IInjector => {
1515
const testInjector = new Yok();

test/stubs.ts

-4
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,6 @@ export class FileSystemStub implements IFileSystem {
178178
}
179179

180180
export class ErrorsStub implements IErrors {
181-
constructor() {
182-
new (require("../lib/common/errors").Errors)(); // we need the side effect of require'ing errors
183-
}
184-
185181
fail(formatStr: string, ...args: any[]): void;
186182
fail(opts: { formatStr?: string; errorCode?: number; suppressCommandHelp?: boolean }, ...args: any[]): void;
187183

test/tools/node-modules/node-modules-dependencies-builder.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface IDependencyInfo {
1010
depth: number;
1111
dependencies?: IDependencyInfo[];
1212
nativescript?: any;
13-
};
13+
}
1414

1515
// TODO: Add integration tests.
1616
// The tests assumes npm 3 or later is used, so all dependencies (and their dependencies) will be installed at the root node_modules

test/xcconfig-service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe("XCConfig Service Tests", () => {
5757
fs.readText = (filename: string, options?: IReadFileOptions | string): string => {
5858
return `// You can add custom settings here
5959
// for example you can uncomment the following line to force distribution code signing
60-
CODE_SIGN_IDENTITY = iPhone Distribution
60+
CODE_SIGN_IDENTITY = iPhone Distribution
6161
// To build for device with XCode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
6262
// DEVELOPMENT_TEAM = YOUR_TEAM_ID;
6363
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
@@ -79,7 +79,7 @@ describe("XCConfig Service Tests", () => {
7979
fs.readText = (filename: string, options?: IReadFileOptions | string): string => {
8080
return `// You can add custom settings here
8181
// for example you can uncomment the following line to force distribution code signing
82-
CODE_SIGN_IDENTITY = iPhone Distribution
82+
CODE_SIGN_IDENTITY = iPhone Distribution
8383
// To build for device with XCode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
8484
// DEVELOPMENT_TEAM = YOUR_TEAM_ID
8585
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon

0 commit comments

Comments
 (0)