Fixed tests.
This commit is contained in:
Родитель
933f7c6c8b
Коммит
07c8c21b98
|
@ -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"])
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче