-
Notifications
You must be signed in to change notification settings - Fork 96
Modifying Tests.js to handle multiple test exports #68
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
Comments
Could you elaborate on the solution you propose? I'm cool with doing: function testSolution1() { }
function testSolution2() { }
function testSolution3() { }
function test() {
testSolution1()
testSolution2()
testSolution3()
}
module.exports.test = test; and then having a |
I'm on phone but I'll try to be elaborate. So what you typed is kinda what we have already anyway, maybe with 1 degree of abstraction lesser where the code for both testSolution1 and testSolution2 for example is within the test method instead of being in separate functions, but either way this already exists. The problem is having to hardcode the method name to be test for instance instead of something more generic. Again since this already exists, I thought your comment earlier was to help move to a state where we're allowed to have multiple functions with whatever names we'd like, have them all exported and run through the Tests.js file without having to hardcode the function names in Tests.js Otherwise, the solution I have in mind is exporting all of the test methods in the test file. |
oh I see what you mean. Yeah, running all the functions in the test file would be fantastic. We can use existing frameworks for that. |
Cool, I plan to do it with vanilla JavaScript instead of introducing a framework. Let me know if that works with you. |
Yes, that works for me |
@ignacio-chiazzo Do you think we can close this issue now as we were able to achieve what we wanted? Or do you have anything else in your mind that we could do to improve the test functionality? |
This is in response to the comment from my last PR.
I've been experimenting ever since, and I think there's a way it could be achieved.
What we want to do:
test
or in some casestest1
,test2
, etc) we have right now,test
function as can be seen here. We want to get rid of this hardcoding as well as be able to invoke varying number of tests per test file as opposed to being able to invoke just 1 test per test file currently.After having explored some of the options Javascript offers, I have found a solution to do this.
I'll be happy to work on the PR if you'd like to assign the issue to me.
The text was updated successfully, but these errors were encountered: