From 5410b8540df772c9231d1eb15eaf7aaf0d0eefd9 Mon Sep 17 00:00:00 2001 From: fatme Date: Tue, 30 Oct 2018 01:55:01 +0200 Subject: [PATCH] fix: show correct messages on `tns test init` command --- lib/commands/test-init.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/commands/test-init.ts b/lib/commands/test-init.ts index 10099c9461..0133a56665 100644 --- a/lib/commands/test-init.ts +++ b/lib/commands/test-init.ts @@ -93,9 +93,10 @@ class TestInitCommand implements ICommand { await this.$pluginsService.add('nativescript-unit-test-runner', this.$projectData); const testsDir = path.join(this.$projectData.appDirectoryPath, 'tests'); + const relativeTestsDir = path.relative(this.$projectData.projectDir, testsDir); let shouldCreateSampleTests = true; if (this.$fs.exists(testsDir)) { - this.$logger.info('app/tests/ directory already exists, will not create an example test project.'); + this.$logger.info(`${relativeTestsDir} directory already exists, will not create an example test project.`); shouldCreateSampleTests = false; } @@ -113,9 +114,9 @@ class TestInitCommand implements ICommand { if (shouldCreateSampleTests && this.$fs.exists(exampleFilePath)) { this.$fs.copyFile(exampleFilePath, path.join(testsDir, 'example.js')); - this.$logger.info('\nExample test file created in app/tests/'.yellow); + this.$logger.info(`\nExample test file created in ${relativeTestsDir}`.yellow); } else { - this.$logger.info('\nPlace your test files under app/tests/'.yellow); + this.$logger.info(`\nPlace your test files under ${relativeTestsDir}`.yellow); } this.$logger.info('Run your tests using the "$ tns test " command.'.yellow);