jquery-serialize-object icon indicating copy to clipboard operation
jquery-serialize-object copied to clipboard

WIP: Add travis-ci support to this project

Open GabLeRoux opened this issue 7 years ago • 2 comments

Build Status

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:

[![Build Status](https://travis-ci.org/macek/jquery-serialize-object
.svg?branch=master)](https://travis-ci.org/macek/jquery-serialize-object)

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.

:tada:

GabLeRoux avatar Feb 27 '18 18:02 GabLeRoux

Currently failing with this:

...
The command "yarn run test" exited with 0.
$ mocha-phantomjs ./test/test.html
Likely due to external resource loading and timing, your tests require calling `window.initMochaPhantomJS()` before calling any mocha setup functions. See https://github.com/nathanboktae/mocha-phantomjs-core/issues/12
The command "mocha-phantomjs ./test/test.html" exited with 1.

and this

$ yarn run spec
yarn run v1.3.2
$ mocha -u tdd --reporter spec
No test files found
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The command "yarn run spec" exited with 1.

GabLeRoux avatar Feb 27 '18 19:02 GabLeRoux

I applied suggested changes, It is still failing on the ci side with this:

$ mocha-phantomjs ./test/test.html
SyntaxError: Parse error

As the file doesn't get generated anymore (it was created by the test command).

For the test part, maybe we can duplicate the test entry in package.json to something like test-ci where open is simply not there. And then we could do both commands with the CI.

  1. build
  2. test (with generated test.html and mocha).

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.

GabLeRoux avatar Feb 28 '18 20:02 GabLeRoux