generator
generator copied to clipboard
Adds the ability to generate a project using ES2015 template
Hi @dougwilson,
As you requested in my previous PR, I adapted my changes to the 4.16 branch and added tests. I found it easier to just clone the 4.16 branch and make the changes again, since there were too many conflicts.
Anyway, this PR has everything there was in the previous PR, and also tests for --es2015 and --es5.
Let me know if there's anything else you need before you merge it :)
Seems like there are some linter warnings, I'll fix them soon. Feel free to look at the code in the meanwhile.
Weird, I can't reproduce the linting errors Travis shows on my local copy.
I ran npm run lint and it produced no errors. Also, all tests in npm run test-ci pass. (that's also the situation in Travis)
@dougwilson, I'm pretty sure my code is OK and ready to be merged.
If you look at the diff on here you can see the linting issues, including that it seems like a lot of unrelated changes to your actual change are in this PR. The Github merge button is disabled until the CI is passing. The purpose of the CI runs is so that it can run in a known-good environment just in case there is something wrong locally. I can produce the same linting errors on my machine as I am seeing on Travis, so there may be somethig going on on your local. You can use the output from Travis CI to manually make the fixes, at least.
Alternatively I can help out by making them for you, but I will need to do this when I am at a computer and may be a bit, apologies.
Hey @dougwilson, you're right. Looking at the diffs, I see them too. Must be vscode's auto-formatting
P.S. I will help make the above changes if you don't get to it first; I wanted to list them in case you have time, otherwise no worries.
@dougwilson I've fixed all of the linting issues, as well as the other comments you had. As to the auto detection test - Could you please elaborate what you had in mind? Travis runs the tests on multiple node versions, but I can't think of a way I could know which version of node is currently executing the test.
@dougwilson is there anything I can do to help move this PR along?
Just needs the test suite to pass in CI and tests added for the auto detection feature that was added in the PR 👌 Sorry I haven't been able to do this myself, but if someone is willing to that would help get this moving again without waiting for me 😄
Sorry, but I also don't have time to finish the PR at the moment. If anyone wants to jump in and fix the tests (it's the only thing that's left, don't think it'll take more than few hours tops), read the PR and create your on PR in my fork.
I do plan to help finish the PR for you, just haven't gotten to it. It seems @imcodingideas is willing to help out 👌
Just an update on this PR. I added a flag to check if the current node version supports these features with: detect.all('const', 'let', 'arrowFunction') in the beforeEach though it seems that this.skip() fails to skip tests with nested describe calls as you can see it's getting fixed here: https://github.com/mochajs/mocha/pull/3225
Just make an if condition then IMHO
@bluzi Im going to wrap this up today at work. This could have been an easy fix but the issue I was running into last night was because the nested describe calls. What I will do is just like you said, wrap everything inside the first before in the if. I can get truthly statement to work when I add the same skip feature inside the nested before and after. I'll come up with something today.
describe('es2015', function() {
before(function() {
if (detectFeature) {
this.skip()
}
})
it('blah blah', function(done) {
// somethings here.
})
describe('npm start', function() {
before(function() {
// something here.
})
after(function() {
// after
})
it('blah blah', function(done) {
// somethings here.
})
})
})
@imcodingideas Do you mean that mochajs/mocha#3225 needs to be fixed first to implement your code? As this.skip() makes test fail?
BTW, I'm really looking forward to this PR being merged.
Was this PR abandoned? Would love to see updated syntax.
Any update on PR? Need to add "import" "export" instead of require().
It's 2019 already. I'm also looking for this functionality; when will this PR be updated?