-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
xo should run after other test scripts #6
Conversation
You might want to just quickly test but you don't care about stylings for now. For example, you add a `console.log` or you add some scripts with no indentation, and then you wanna quickly run the test scripts.
I kinda agree. I've been annoyed at having to fix style issues during development too. @joakimbeng @Qix- @markogresak @dthree Thoughts? |
This is what I was talking about a while back; I wish EDIT: Meh; you're using |
How is it not portable? Even Windows supports it.
I didn't have any strong arguments. It's just less bloated using |
Sure it does, but being the purist I am, I wouldn't rely on it personally. Using I understand they're the same, but separating them out seems less hackish. Also, I believe logging helps too (however minutely) because NPM separates them out into logical steps. Using |
I highly doubt that, but I also don't feel strongly about using // @arthurvr @floatdrop @vdemedes |
One last note: By using Which kind of makes me wish it supported arrays of commands, like Travis does. |
I agree with @Qix- I just honestly don't see anyone using |
I personally prefer using I was hoping one could use the {
"scripts": {
"lint": "xo",
"pretest": "npm run -s lint",
"test": "ava"
}
} and running |
I'd normally jump to suggest someone creating a ticket over at NPM but alas I think this has been discussed before. A ticket is welcome and I would support it. |
|
@stevemao Though the point of the flag would be to, for a single run, skip pre/post tests. |
I know. As I said I think pre/post shouldn't be skipped. |
Personally, I am used to
Use |
Is that Windows compatible? |
Yes, fixing styling issues mid dev was driving me crazy. vdemedes' suggestion looked promising, however it doesn't seem to be working on Windows. |
I'm 50% sure |
But this is nothing one wants. As stated in XO's readme:
So therefore is |
Pipe worked even in Windows XP, source. But you are correct about And regarding the previous discussion, the I've also tested all of the above in my Windows 10 VB and it's still the same.
I like the idea of adding linter to test step, in my projects I'm running the linter before other tests, sometimes it can prevent failed tests because of something stupid in my code. I don't see the point of using the lint tool after, if the tests pass there are probably no serious errors, it serves just as a "Is the code pretty?" check. The suggested |
So it sounds like we should open a ticket for multiple scripts on NPM. |
No, even though the user is on PowerShell, npm scripts are run using the Node.js |
This would mean rewriting the whole json parser. I wouldn't want to be near the issues that this will lead to. As said, it's how JS engines works, you can't have multiple keys with same name. Example: {
"test": "...1",
"test": "...2"
} Will be parsed ( { test: "...2" } Does this make the issue I was trying to point out more clear?
I didn't know that, when I said I've tested it, I used the actual shell, not a script ran via npm. If that is the case, then using the |
@markogresak I think @Qix- meant: {
"test": [
"...1",
"...2"
]
} |
Haha yes, that's indeed what I meant. I left a comment on that issue pointing back to this. |
@Qix- That makes more sense, I haven't even thought of it before @sindresorhus pointed it out. It would be great if they figure out something and not just for this project, but for many workflows out there. |
Any conclusion? |
I found some other useful information. If there is a typo-as-programmer-error, it should be caught by linter (as it's probably faster than running your whole tests, or for whatever reason the test doesn't point you to the right code). In this case, its probably better to run the linter first. I think they should both always execute no matter what order they are, they could run together asynchronously even one fails. The tricky part would be how you print the reports. I think a simple bash script may not be ideal then. |
Decision time: #8 (comment) Thanks all for participating in the discussion :) |
You might want to just quickly test but you don't care about stylings for now. For example, you add a
console.log
or you add some scripts with no indentation, and then you wanna quickly run the test scripts.