Skip to content

Commit a4943ca

Browse files
author
Fatme
authored
Merge pull request #4080 from NativeScript/fatme/fix-test-init
fix: show correct messages on `tns test init` command
2 parents 850ad12 + 5410b85 commit a4943ca

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/commands/test-init.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@ class TestInitCommand implements ICommand {
9393
await this.$pluginsService.add('nativescript-unit-test-runner', this.$projectData);
9494

9595
const testsDir = path.join(this.$projectData.appDirectoryPath, 'tests');
96+
const relativeTestsDir = path.relative(this.$projectData.projectDir, testsDir);
9697
let shouldCreateSampleTests = true;
9798
if (this.$fs.exists(testsDir)) {
98-
this.$logger.info('app/tests/ directory already exists, will not create an example test project.');
99+
this.$logger.info(`${relativeTestsDir} directory already exists, will not create an example test project.`);
99100
shouldCreateSampleTests = false;
100101
}
101102

@@ -113,9 +114,9 @@ class TestInitCommand implements ICommand {
113114

114115
if (shouldCreateSampleTests && this.$fs.exists(exampleFilePath)) {
115116
this.$fs.copyFile(exampleFilePath, path.join(testsDir, 'example.js'));
116-
this.$logger.info('\nExample test file created in app/tests/'.yellow);
117+
this.$logger.info(`\nExample test file created in ${relativeTestsDir}`.yellow);
117118
} else {
118-
this.$logger.info('\nPlace your test files under app/tests/'.yellow);
119+
this.$logger.info(`\nPlace your test files under ${relativeTestsDir}`.yellow);
119120
}
120121

121122
this.$logger.info('Run your tests using the "$ tns test <platform>" command.'.yellow);

0 commit comments

Comments
 (0)