forcedotcom / LightningTestingService

Apache License 2.0
122 stars 35 forks source link

Doc question: "test" folder behavior #59

Closed pozil closed 6 years ago

pozil commented 6 years ago

Hi,

I have been looking at the documenation for the Salesforce DX project structure but I could not find anything regarding the test folder (lightning-component-tests/test/default in your repository).

I do not want to deploy my Lightning tests in production so should I use this folder in combination with the main directory like you did? I am also Java dev so this project structures means something for me but does it translate to DX? You may want to document it if there are special rules for this folder.

Cheers,

esalman-sfdc commented 6 years ago

That is just a convention which relies on SFDX CLI ability to aggregate the metadata from multiple sub-dirs. To control what gets deployed based on the environment you are targeting I think discussion here is relevant.

pozil commented 6 years ago

Thanks @esalman-sfdc, I ended up with a similar of solution that does not require any plugin. I'll share it here if it can help:

I have two SFDX project files that contain my 'core app' and 'test' deployment info:

config/sfdx-project-app.json
config/sfdx-project-lightning-tests.json

I have created a simple set-config.sh shell script that does this:

cp -f config/sfdx-project-$1.json sfdx-project.json

This way I can easily switch the deployment mode by calling one of these:

./set-config.sh app
./set-config.sh lightning-tests