This commit is contained in:
Daniel Lebu 2016-04-18 13:32:59 -07:00
Родитель 933f7c6c8b
Коммит 07c8c21b98
2 изменённых файлов: 38 добавлений и 39 удалений

2
.vscode/launch.json поставляемый
Просмотреть файл

@ -17,7 +17,7 @@
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["test/testProject", "--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ],
"args": ["${workspaceRoot}/test/testProject", "--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ],
"stopOnEntry": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}/out/src",

Просмотреть файл

@ -27,56 +27,55 @@ suite("VSCode Cordova extension - intellisense and command palette tests", () =>
return testUtils.removeCordovaComponents("plugin", testProjectPath, ["cordova-plugin-file", "cordova-plugin-whitelist"])
});
function checkTypeDefinitions(expectedTypedDefs: string[])
{
function checkTypeDefinitions(expectedTypedDefs: string[]) {
let actualTypeDefs = testUtils.enumerateListOfTypeDefinitions(testProjectPath);
assert.deepEqual(actualTypeDefs, expectedTypedDefs);
};
test('Plugin type definitions are installed on activation', () => {
test('#Plugin type definitions are installed on activation', () => {
return Q.delay(10000).then(() => {
checkTypeDefinitions(["FileSystem.d.ts"]);
});
});
test('Plugin type defintion for a plugin is added upon adding that plugin', () => {
test('#Plugin type defintion for a plugin is added upon adding that plugin', () => {
return testUtils.addCordovaComponents("plugin", testProjectPath, ["cordova-plugin-device"])
.then(() => {
return Q.delay(10000);
}).then(() => {
checkTypeDefinitions(["Device.d.ts", "FileSystem.d.ts"]);
});
});
test('Plugin type definition for a plugin is removed after removal of that plugin', () => {
return testUtils.removeCordovaComponents("plugin", testProjectPath, ["cordova-plugin-device"])
.then(() => {
return Q.delay(10000);
}).then(() => {
checkTypeDefinitions(["FileSystem.d.ts"]);
});
});
test('Verify that the commands registered by Cordova extension are loaded', () => {
return vscode.commands.getCommands(true)
.then((results) => {
let cordovaCmdsAvailable = results.filter((commandName: string) => {
return commandName.indexOf("cordova.") > -1
.then(() => {
return Q.delay(10000);
}).then(() => {
checkTypeDefinitions(["Device.d.ts", "FileSystem.d.ts"]);
});
assert.deepEqual(cordovaCmdsAvailable, ["cordova.build", "cordova.run", "cordova.prepare"])
});
});
test('Execute Commands from the command palette', () => {
return testUtils.addCordovaComponents("platform", testProjectPath, ["windows"])
.then(() => {
return vscode.commands.executeCommand("cordova.build");
}).then(() => {
return Q.delay(10000);
}).then(res => {
let appxPackagesParentPath = path.resolve(testProjectPath, "platforms", "windows", "AppPackages");
assert.ok(CordovaProjectHelper.existsSync(appxPackagesParentPath));
return testUtils.removeCordovaComponents("platform", testProjectPath, ["windows"])
});
test('#Plugin type definition for a plugin is removed after removal of that plugin', () => {
return testUtils.removeCordovaComponents("plugin", testProjectPath, ["cordova-plugin-device"])
.then(() => {
return Q.delay(10000);
}).then(() => {
checkTypeDefinitions(["FileSystem.d.ts"]);
});
});
test('#Verify that the commands registered by Cordova extension are loaded', () => {
return vscode.commands.getCommands(true)
.then((results) => {
let cordovaCmdsAvailable = results.filter((commandName: string) => {
return commandName.indexOf("cordova.") > -1
});
assert.deepEqual(cordovaCmdsAvailable, ["cordova.prepare", "cordova.build", "cordova.run", "cordova.simulate"])
});
});
test('#Execute Commands from the command palette', () => {
return testUtils.addCordovaComponents("platform", testProjectPath, ["android"])
.then(() => {
return vscode.commands.executeCommand("cordova.build");
}).then(() => {
return Q.delay(10000);
}).then(res => {
let androidBuildPath = path.resolve(testProjectPath, "platforms", "android", "build");
assert.ok(CordovaProjectHelper.existsSync(androidBuildPath));
return testUtils.removeCordovaComponents("platform", testProjectPath, ["android"])
});
});
});