Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add e2e testing support using Ava #303

Merged
merged 29 commits into from
Aug 31, 2019
Merged

feat: Add e2e testing support using Ava #303

merged 29 commits into from
Aug 31, 2019

Conversation

vinayakkulkarni
Copy link
Contributor

This PR enables users to perform E2E testing the Nuxt app using Ava test runner.

Copy link
Member

@clarkdo clarkdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Only a tiny point.

template/_package.json Outdated Show resolved Hide resolved
template/_package.json Outdated Show resolved Hide resolved
Copy link
Member

@clarkdo clarkdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see some dir are test and others are tests, can me keep consistency?

@vinayakkulkarni
Copy link
Contributor Author

I can see some dir are test and others are tests, can me keep consistency?

the reason for that was the /test directory holds the actual e2e & unit tests whereas the /tests directory holds the testing setup.

it could be /test/setup where the e2e.config.js & unit.config.js could stay.. would be much cleaner.

@clarkdo
Copy link
Member

clarkdo commented Aug 5, 2019

The config file can be just in test root dir or each own test dir ?

@vinayakkulkarni
Copy link
Contributor Author

vinayakkulkarni commented Aug 5, 2019

The config file can be just in test root dir or each own test dir ?

OK, according to the Ava docs

The configuration file must be in the same directory as the package.json file.

Hence the e2e.config.js & unit.config.js were created in the root dir rather than inside the test directory.

@clarkdo
Copy link
Member

clarkdo commented Aug 5, 2019

If so, can we only reserve ava.config.js and use process.env.TEST to apply different configurations?

@vinayakkulkarni
Copy link
Contributor Author

With dedicated config files. It'll be better to modify / update individual testing settings rather than have one huge ava.config.js with if-else checks.

Plus, that's how its recommended in Ava docs.

@clarkdo
Copy link
Member

clarkdo commented Aug 7, 2019

With dedicated config files. It'll be better to modify / update individual testing settings rather than have one huge ava.config.js with if-else checks.

Plus, that's how its recommended in Ava docs.

If so, what the point for setting TEST for each script ?

@vinayakkulkarni
Copy link
Contributor Author

vinayakkulkarni commented Aug 8, 2019 via email

@clarkdo clarkdo closed this Aug 12, 2019
@clarkdo clarkdo reopened this Aug 12, 2019
@clarkdo
Copy link
Member

clarkdo commented Aug 12, 2019

Sorry for the mis-clicking, I just wondered that unit.config.js and e2e.config.js may be a little confusing since they don't indicate that they're ava related config files.

@vinayakkulkarni
Copy link
Contributor Author

Isn't that a good thing? They could be used to setup a whole testing framework within the nuxt app if anyone wants to use it in that bifurcated way?

Maybe using jest someone wants to do unit testing and using karma they want to do e2e testing and these two files could be modified for that purpose?

@clarkdo
Copy link
Member

clarkdo commented Aug 31, 2019

This pr can be merged after resolving conflicts

@clarkdo clarkdo merged commit 4d8fe95 into nuxt:master Aug 31, 2019
@clarkdo
Copy link
Member

clarkdo commented Aug 31, 2019

Thanks!

@vinayakkulkarni vinayakkulkarni deleted the ava-add-e2e-testing branch August 31, 2019 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants