Skip to content
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

Make CI run browser tests #2231

Merged
merged 4 commits into from
May 23, 2016
Merged

Make CI run browser tests #2231

merged 4 commits into from
May 23, 2016

Commits on May 21, 2016

  1. Initial prep for browser tests in CI

    - ⬆️ [email protected]
    
      Some fixes that we didn't have were required.
    
    - πŸ› Fix browser not being able to require describe/it
    
      `support/browser-entry.js` was removing the listener that is in charge
      of keeping `Mocha.describe/it/suite` etc up-to-date.
    
      That listener is now added everytime a `ui` is set up.
    
    - Correct isatty for browser
    dasilvacontin authored and boneskull committed May 21, 2016
    Configuration menu
    Copy the full SHA
    3ad9c4e View commit details
    Browse the repository at this point in the history

Commits on May 22, 2016

  1. Travis + SauceLabs + Karma setup (first pass)

    - add sauce connect
    - prepare to use karma on saucelabs; fix potential windows problems
    - rewrite `scripts/ensure-compatible-npm.sh` in JS
    - detect travis node 0.8 env; just upgrade if found
    - symlink `mocha` to itself for `karma-mocha`
    - if explicit `--production` flag is present, skip this
    - don't know how to skip this part if `mocha` is a devDep of some other package
    - use [email protected]; don't try to install npm@3
    - browser tests with karma & phantom
    - move `support/browser-entry.js` to `browser-entry.js` to keep paths sane
    - `karma.conf.js` loads data out of `.karma.conf.js`
      - we have a "main" browser suite
        - then we have suites for each interface
        - each suite is a single run of Karma
        - each suite is executed by the `Makefile`
      - build `./mocha.js` upon test execution for `karma-mocha` to use
      - bonus: 3rd-party browserification should theoretically now be possible as per the `./index.js` entry in `package.json`'s `browser` field
      - add dev deps for karma
      - test changes:
        - split `lookupFiles` test into its own file so we can ignore it in Karma
        - fix broken `test/acceptance/throw.js` for browser
        - fix `test/acceptance/utils.js`'s `type` tests for PhantomJS
    - try to reduce build matrix
    - fix missing targets
    - fix infinite loop in Makefile
    - downgrade phantomjs to 1.9.8
    - remove some cruft from karma config; try to add sauce labs
    - try again w/ the saucelabs
    - typo
    - remove karma-source-map-support as it's a no-go on IE8
    - Require up-to-date mocha.js for any browser tests
    - Make CI rebuild mocha.js.  Make won't rebuild when just checked out by CI because timestamps on source and mocha.js are the same.  We could use a script to set the timestamps to the commit time, but it still wouldn't work if mocha.js were committed along with other changes that hadn't been built into it. Which shouldn't happen anyway -- but then again, the point of CI is to see what commits change, it's usually going to need to rebuild mocha.js if it's working right, so it's not going to hurt much to rebuild it every time even on the few times it doesn't need to.
    boneskull authored and dasilvacontin committed May 22, 2016
    Configuration menu
    Copy the full SHA
    2ead281 View commit details
    Browse the repository at this point in the history
  2. fix IE8 compatibility for browser tests

    - Avoid `Array.prototype.map` in test
    - Workaround for missing `Object.create`
    - Use a shim for `Date.prototype.toISOString`
    - Use simple number math instead of array indexing for interface tests
    - Use `expect` instead of `should`
    - Avoid builtin function in stringify test (A quick check revealed that stringify does not treat toString specially anyway, and IE8 ignores the toString assigned to the object, so use a different property name)
    - Use `karma-expect` for automatic browser tests
    - Remove `karma-should`
    ScottFreeCode authored and dasilvacontin committed May 22, 2016
    Configuration menu
    Copy the full SHA
    e7e8554 View commit details
    Browse the repository at this point in the history
  3. Travis + SauceLabs + Karma setup (second pass)

    - add note about exporting `global` in `browser-entry.js`
    - remove too-short timeout for "throw" unit tests (because SauceLabs)
    - revert modification to `isatty()` function of `lib/browser/tty.js`
    - switch reporter to `karma-spec-reporter`
    - use custom `karma-no-mocha` package
    - fixtures in `test/browser-fixtures/`
    - use single `karma.conf.js`
    boneskull authored and dasilvacontin committed May 22, 2016
    Configuration menu
    Copy the full SHA
    8ee7795 View commit details
    Browse the repository at this point in the history