-
-
Notifications
You must be signed in to change notification settings - Fork 197
Add tracking for the project types that users are creating and working with #2492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,6 +112,7 @@ class ProjectIntegrationTest { | |
this.testInjector.register("fs", FileSystem); | ||
this.testInjector.register("projectDataService", ProjectDataServiceLib.ProjectDataService); | ||
this.testInjector.register("staticConfig", StaticConfig); | ||
this.testInjector.register("analyticsService", { track: () => Future.fromResult() }); | ||
|
||
this.testInjector.register("npmInstallationManager", NpmInstallationManager); | ||
this.testInjector.register("npm", NpmLib.NodePackageManager); | ||
|
@@ -134,12 +135,12 @@ class ProjectIntegrationTest { | |
|
||
describe("Project Service Tests", () => { | ||
describe("project service integration tests", () => { | ||
let defaultTemplatePath:string; | ||
let defaultSpecificVersionTemplatePath:string; | ||
let angularTemplatePath:string; | ||
let defaultTemplatePath: string; | ||
let defaultSpecificVersionTemplatePath: string; | ||
let angularTemplatePath: string; | ||
let typescriptTemplatePath: string; | ||
|
||
before(function() { | ||
before(function () { | ||
let projectIntegrationTest = new ProjectIntegrationTest(); | ||
let fs: IFileSystem = projectIntegrationTest.testInjector.resolve("fs"); | ||
let npmInstallationManager: INpmInstallationManager = projectIntegrationTest.testInjector.resolve("npmInstallationManager"); | ||
|
@@ -153,7 +154,7 @@ describe("Project Service Tests", () => { | |
"readme": "dummy", | ||
"repository": "dummy" | ||
}); | ||
npmInstallationManager.install("tns-template-hello-world", defaultTemplateDir, {dependencyType: "save"}).wait(); | ||
npmInstallationManager.install("tns-template-hello-world", defaultTemplateDir, { dependencyType: "save" }).wait(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can use |
||
defaultTemplatePath = path.join(defaultTemplateDir, "node_modules", "tns-template-hello-world"); | ||
fs.deleteDirectory(path.join(defaultTemplatePath, "node_modules")); | ||
|
||
|
@@ -166,7 +167,7 @@ describe("Project Service Tests", () => { | |
"readme": "dummy", | ||
"repository": "dummy" | ||
}); | ||
npmInstallationManager.install("tns-template-hello-world", defaultSpecificVersionTemplateDir, {version: "1.4.0", dependencyType: "save"}).wait(); | ||
npmInstallationManager.install("tns-template-hello-world", defaultSpecificVersionTemplateDir, { version: "1.4.0", dependencyType: "save" }).wait(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can use constants.RESERVED_TEMPLATE_NAMES["default"] instead of "tns-template-hello-world" |
||
defaultSpecificVersionTemplatePath = path.join(defaultSpecificVersionTemplateDir, "node_modules", "tns-template-hello-world"); | ||
fs.deleteDirectory(path.join(defaultSpecificVersionTemplatePath, "node_modules")); | ||
|
||
|
@@ -179,7 +180,7 @@ describe("Project Service Tests", () => { | |
"readme": "dummy", | ||
"repository": "dummy" | ||
}); | ||
npmInstallationManager.install("tns-template-hello-world-ng", angularTemplateDir, {dependencyType: "save"}).wait(); | ||
npmInstallationManager.install("tns-template-hello-world-ng", angularTemplateDir, { dependencyType: "save" }).wait(); | ||
angularTemplatePath = path.join(angularTemplateDir, "node_modules", "tns-template-hello-world-ng"); | ||
fs.deleteDirectory(path.join(angularTemplatePath, "node_modules")); | ||
|
||
|
@@ -192,7 +193,7 @@ describe("Project Service Tests", () => { | |
"readme": "dummy", | ||
"repository": "dummy" | ||
}); | ||
npmInstallationManager.install("tns-template-hello-world-ts", typescriptTemplateDir, {dependencyType: "save"}).wait(); | ||
npmInstallationManager.install("tns-template-hello-world-ts", typescriptTemplateDir, { dependencyType: "save" }).wait(); | ||
typescriptTemplatePath = path.join(typescriptTemplateDir, "node_modules", "tns-template-hello-world-ts"); | ||
fs.deleteDirectory(path.join(typescriptTemplatePath, "node_modules")); | ||
}); | ||
|
@@ -447,7 +448,7 @@ describe("Project Service Tests", () => { | |
projectIntegrationTest.createProject(projectName).wait(); | ||
options.copyFrom = defaultTemplatePath; | ||
|
||
projectIntegrationTest.assertProject(tempFolder, projectName, `org.nativescript.${projectName}`,null).wait(); | ||
projectIntegrationTest.assertProject(tempFolder, projectName, `org.nativescript.${projectName}`, null).wait(); | ||
}); | ||
}); | ||
|
||
|
@@ -468,6 +469,7 @@ function createTestInjector() { | |
testInjector.register("projectDataService", ProjectDataServiceLib.ProjectDataService); | ||
|
||
testInjector.register("staticConfig", StaticConfig); | ||
testInjector.register("analyticsService", { track: () => Future.fromResult() }); | ||
|
||
testInjector.register("npmInstallationManager", NpmInstallationManager); | ||
testInjector.register("httpClient", HttpClientLib.HttpClient); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing case when template is case sensitive folder.
If the developer uses
App
asoriginalTemplateName
and then usesapp
these can be two different apps. I'm OK with us not supporting this scenario, and either way there aren't such tests, but thought you should know.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact the case is handled - when
originalTemplateName
isapp
, thename
variable will be set toapp
.At this point
templateName
will be set toapp
.At another point, when user passes
--template App
,originalTemplateName
will be set toApp
, thename
variable will be set toApp
and thetemplateName
will be set toApp
again.