From 8d7f8d21192798f5a105aa7144fea81b4abe36e3 Mon Sep 17 00:00:00 2001 From: Elena Hristova Date: Wed, 25 Sep 2019 15:41:57 +0300 Subject: [PATCH 1/2] feat: add vue tabs navigation template to create project command --- docs/man_pages/project/creation/create.md | 1 + lib/commands/create-project.ts | 5 +++++ test/project-commands.ts | 17 ++++++++--------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/docs/man_pages/project/creation/create.md b/docs/man_pages/project/creation/create.md index 1391f6a90e..9ff5957602 100644 --- a/docs/man_pages/project/creation/create.md +++ b/docs/man_pages/project/creation/create.md @@ -53,6 +53,7 @@ Template | Command `Angular - Tabs` | tns create --template tns-template-tab-navigation-ng `Vue.js - Blank`, `--vue`, `--vuejs` | tns create --template tns-template-blank-vue `Vue.js - SideDrawer`, | tns create --template tns-template-drawer-navigation-vue +`Vue.js - Tabs` | tns create --template tns-template-tab-navigation-vue ### Related Commands diff --git a/lib/commands/create-project.ts b/lib/commands/create-project.ts index 9c253c733a..e1b9330e55 100644 --- a/lib/commands/create-project.ts +++ b/lib/commands/create-project.ts @@ -210,6 +210,11 @@ or --js flags.) key: CreateProjectCommand.DrawerTemplateKey, value: "tns-template-drawer-navigation-vue", description: CreateProjectCommand.DrawerTemplateDescription + }, + { + key: CreateProjectCommand.TabsTemplateKey, + value: "tns-template-tab-navigation-vue", + description: CreateProjectCommand.TabsTemplateDescription }]; return templates; diff --git a/test/project-commands.ts b/test/project-commands.ts index 68b66d0803..99af2cb4eb 100644 --- a/test/project-commands.ts +++ b/test/project-commands.ts @@ -18,15 +18,14 @@ const expectedFlavorChoices = [ { key: "Plain TypeScript", description: "Learn more at https://nativescript.org/typescript" }, { key: "Plain JavaScript", description: "Use NativeScript without any framework" } ]; -const expectedTemplateChoices = [ - { key: "Hello World", description: "A Hello World app" }, - { key: "SideDrawer", description: "An app with pre-built pages that uses a drawer for navigation" }, - { key: "Tabs", description: "An app with pre-built pages that uses tabs for navigation" } -]; -const expectedTemplateChoicesVue = [ - { key: "Blank", description: "A blank app" }, - { key: "SideDrawer", description: "An app with pre-built pages that uses a drawer for navigation" } -]; +const templateChoises = { + helloWorld: { key: "Hello World", description: "A Hello World app" }, + blank: { key: "Blank", description: "A blank app" }, + sideDrawer: { key: "SideDrawer", description: "An app with pre-built pages that uses a drawer for navigation" }, + tabs: { key: "Tabs", description: "An app with pre-built pages that uses tabs for navigation" } +}; +const expectedTemplateChoices = [templateChoises.helloWorld, templateChoises.sideDrawer, templateChoises.tabs]; +const expectedTemplateChoicesVue = [templateChoises.blank, templateChoises.sideDrawer, templateChoises.tabs]; class ProjectServiceMock implements IProjectService { async validateProjectName(opts: { projectName: string, force: boolean, pathToProject: string }): Promise { From 20d7ca3ab94207a46494642eb6a79ea9b904a133 Mon Sep 17 00:00:00 2001 From: fatme Date: Fri, 27 Sep 2019 11:55:13 +0300 Subject: [PATCH 2/2] fix: fix unit tests with node v12.11.0 Unit tests cannot be executed with node v12.11.0 due to changes in `util.format`. --- lib/common/test/unit-tests/logger.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common/test/unit-tests/logger.ts b/lib/common/test/unit-tests/logger.ts index 8ed141710d..8b9c5d6fff 100644 --- a/lib/common/test/unit-tests/logger.ts +++ b/lib/common/test/unit-tests/logger.ts @@ -162,14 +162,14 @@ describe("logger", () => { [undefined, null, false, "string value", 42, { obj: 1 }, ["string value 1", "string value 2"]].forEach(value => { it(`handles formatted message with '${value}' value in one of the args`, () => { logger.info("test %s", value); - assert.equal(outputs.info, `test ${value}`); + assert.equal(outputs.info, util.format("test %s", value)); assert.deepEqual(outputs.context, {}, "Nothing should be added to logger context."); assert.deepEqual(outputs.removedContext, {}, "Removed context should be empty."); }); it(`handles formatted message with '${value}' value in one of the args and additional values passed to context`, () => { logger.info("test %s", value, { [LoggerConfigData.skipNewLine]: true }); - assert.equal(outputs.info, `test ${value}`); + assert.equal(outputs.info, util.format("test %s", value)); assert.deepEqual(outputs.context, { [LoggerConfigData.skipNewLine]: true }, `${LoggerConfigData.skipNewLine} should be set with value true.`); assert.deepEqual(outputs.removedContext, { [LoggerConfigData.skipNewLine]: true }, `Removed context should contain ${LoggerConfigData.skipNewLine}`); });