question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

add the ability to choose in the config the file names

See original GitHub issue

Adds the ability to the user to insert the file name. Something like this in the config:

{
  ...
  file_name: {
    test: 'COMPONENT_NAME.test.js',
    etc
  }
}

thanks to @viktorbergehall

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
iagodahlemcommented, Jul 14, 2017

Hey @CVarisco, that’s a great feature that I will really appreciate to use. I will try to figure this out and open a PR.

But first, I have some suggestions. What do you think about pass just the prefix used in the file name to config? Like this:

{
  ...
  file_name: {
    test: 'test', //or
    test: 'spec', // or
    etc
  }
}

I think this way will be better to deal with the name and extension of the file, and just do something like this to generate the name of the file:

fs.outputFile(`${destination}/${name}.{testPrefix}.${jsExtension}`, generateTestTemplate(name))

What do you think?

1reaction
iagodahlemcommented, Jul 15, 2017

Hey @CVarisco! I thank you man.

I guess that I get it. So let’s see, your idea is, let user pass some optional options to file_name property, being some of this options:

  • testPrefix: Overrides the match word used on test files, for instance.
  • test: Overrides the name used on test files.
  • component: Override the name used on the component file itself.

What do you think? Do you have any other option in mind? Let’s try to get and document all possible options that we want to add.

Another suggestions that I have for the options name, tell me what you think:

  • testFileMatch, instead of testPrefix, default value to test.
  • testFileName, instead of test, default value to COMPONENT_NAME.
  • componentFileName, instead of component, default to COMPONENT_NAME.

So we use like this:

{
  "fileNames": {
    "testFileMatch": "spec"
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Establishing Windows File and Folder Level Permissions
view the file names and subfolders. navigate to subfolders. view data in the folder's files. ... Right click » select New » select...
Read more >
Store custom information from a configuration file - C#
In Solution Explorer, right-click the project name, select Add, and then select New Item. In the Add New Item list, select XML File....
Read more >
Configuration Files - ESLint - Pluggable JavaScript Linter
ESLint supports adding shared settings into configuration files. Plugins use settings to specify the information that should be shared across all of its...
Read more >
What is configuration file? | Definition from TechTarget
A configuration file, often shortened to config file, defines the parameters, options, settings and preferences applied to operating systems (OSes), ...
Read more >
What are good file naming conventions?
Here is the potential problem: A user would like to download a directory of files to their desktop. Some of these files have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found