Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/commands/test-init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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 <platform>" command.'.yellow);
Expand Down