image-sequencer
                                
                                 image-sequencer copied to clipboard
                                
                                    image-sequencer copied to clipboard
                            
                            
                            
                        test cli steps parsing
Ref #1747
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
- [ ] tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with npm run test-all
- [ ] code is in uniquely-named feature branch and has no merge conflicts
- [ ] PR is descriptively titled
- [ ] ask @publiclab/is-reviewersfor help, in a comment below
- [ ] Insert-step functionality is working correct as expected.
We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!
If tests do fail, click on the red X to learn why by reading the logs.
Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software Please make sure to get at least two reviews before asking for merging the PR as that would make the PR more reliable on our part Thanks!
I am facing a few roadblocks while making this test.
- I am not sure why node test/cli/*.jsisn't running the newly created file.
- Even after using async/await it doesn't wait for the cli to stop processing, the program proceeds right after it warns about 'Output directory will remain empty till execution'
- When I try to read the error logs, it seems that the exit call stops the execution of test too.
Any kind of help appreciated
cc @jywarren @HarshKhandeparkar
Does node test/cli/steps.js work by itself? I'm pretty stumped too here, i wonder if it's something simple we're overlooking...
Does
node test/cli/steps.jswork by itself?
Yup, I have attached the output below
I'm pretty stumped too here, i wonder if it's something simple we're overlooking...
Me too 😓
Here's the output, running *.js should match all the files, running steps.js individually does work.
$ node test/cli/*.js
TAP version 13
# testing save sequence function
 Your sequence was saved successfully!!
ok 1 creation success
ok 2 creation fail
1..2
# tests 2
# pass  2
# ok
$ node test/cli/steps.js 
TAP version 13
# testing steps parsing
Please wait 
 output directory generated will be empty until the execution is complete
ok 1 Steps parsed successfully
1..1
# tests 1
# pass  1
# ok
Also I made the test pass by adding blocking code, but I don't think that would be the right way to proceed, what are your opinion about it?