WIP: Add travis-ci support to this project#119
WIP: Add travis-ci support to this project#119GabLeRoux wants to merge 10 commits intomacek:masterfrom
Conversation
|
Currently failing with this: and this |
| - mocha-phantomjs --version | ||
|
|
||
| script: | ||
| - yarn run test |
There was a problem hiding this comment.
this should just be yarn run build, then the test script doesn't have to be modified. is that correct?
There was a problem hiding this comment.
and don't forget to add Mocha to devDependencies in package.json
There was a problem hiding this comment.
I'm not sure what you mean by this:
this should just be
yarn run build, then thetestscript doesn't have to be modified. is that correct?
Do you mean that this is travis's default behaviour so we could delete the script part? Since there are other commands after this one, I think this is necessary.
and don't forget to add Mocha to
devDependenciesin package.json
definitely 👍
There was a problem hiding this comment.
I'm suggesting the following revisions
in travis.yml just run build directly
script:
- - yarn run test
+ - yarn run build
- mocha-phantomjs ./test/test.html
- yarn run specin package.json restore the original test script; there was really no reason to modify it
"scripts": {
- "test": "npm run build",
+ "test": "npm run build && open ./test/test.html",
"spec": "mocha -u tdd --reporter spec",
"build": "npm run minify",
"minify": "uglifyjs jquery.serialize-object.js -m -c --comments > dist/jquery.serialize-object.min.js"
},
...
"devDependencies": {
+ "mocha": "^5.0.1",
"uglify-js": "^2.4.16"
}Does that make sense?
There was a problem hiding this comment.
In hindsight, the build and minify scripts cross concerns. It's a separate issue but should be patched as
- "build": "npm run minify",
+ "build": "npm run minify > dist/jquery.serialize-object.min.js",
- "minify": "uglifyjs jquery.serialize-object.js -m -c --comments > dist/jquery.serialize-object.min.js"
+ "minify": "uglifyjs jquery.serialize-object.js -m -c --comments"If you want to sneak that in this PR, I'm cool with that
|
I applied suggested changes, It is still failing on the ci side with this: As the file doesn't get generated anymore (it was created by the For the test part, maybe we can duplicate the
If test passes, we can also deploy artifacts when ran on master which would ease the release of new versions. For the mocha part, I may need some help and time. I'll have a look at this in the next weeks. |
I didn't go in too much details, but I managed to get the CI working on this project. I suppose this can be improved, but at least if it's there, someone else may improve the tests for this project 👍
Owner (@macek macek) needs to enable travis-ci project on travis-ci.org. Then, we can also add this to the readme:
See results here:
https://travis-ci.org/GabLeRoux/jquery-serialize-object
this still needs some more work, help would be appreciated.
Here's an example project with mocha running with phantom in travis:
https://github.com/jh3y/testPlayground
And a related blog post:
https://medium.com/caffeine-and-testing/getting-started-with-mocha-bfa20d403186
I don't have much time right now to continue working on this, but I think it's a good starting point.
🎉