tgvashworth / fetch-engine

A smart request-making library
24 stars 6 forks source link

Added Karma runner and BrowserStack testing #53

Closed ghost closed 8 years ago

ghost commented 8 years ago

PR for #16

Karma Runner

Karma facilitates the configuration for adding extra services to the testing process. In this case adding BrowserStack testing was just a matter of installing karma-browserstack-launcher and adding karma.browserstack.conf.ts

BrowserStack

karma-browserstack-launcher expects the following environment variables to be set for BrowserStack authentication: BROWSERSTACK_USERNAME and BROWSERSTACK_KEY.

These can be acquired in the BrowserStack account settings page at the bottom Automate section:

browserstack_automate

And added in the Travis repo settings page at the Environment Variables section:

travis_environment_vars

BrowserStack Browsers & Mobile Devices for JavaScript Testing

Testing Configuration

The files for testing configuration are in ./testing/. All in TypeScript for linting, and compiled by the npm script build-conf (I haven't found a way to pipe tsc directly to karma without creating files).

ghost commented 8 years ago

@phuu Don't know if you're planning on semantic-release or any pull request formatting, so I tried to make it detailed and clear.

tgvashworth commented 8 years ago

Hey @thelambdaparty — thanks for this. I was a bit unclear in the issue originally (sorry about that) — it's totally fine for the testing files to be JavaScript, I just meant it'd be great to match code-style.

However, I'll probably merge this onto a branch and iterate until the build is passing. Sound good?

ghost commented 8 years ago

@phuu Sure!

I added the comments there just so you know what I did, README or docs will be better. The || true for Typescript was for testing the rest of the build (see if it runs ok), but it should surely be removed, otherwise it's evading TS's best feature :smile:

Another branch for iteration sounds cool :+1:

tgvashworth commented 8 years ago

Good stuff.

GitHub can't change target branches for PRs — would you mind closing and reopening on something like a like karma branch please? I'll merge and pickup getting it passing on travis.

ghost commented 8 years ago

Created branch karma: https://github.com/thelambdaparty/fetch-engine/tree/karma Will you open a karma branch too or send PR to browserstack branch? (sorry for the open/close :smile: didn't expect it would block comments)

tgvashworth commented 8 years ago

@thelambdaparty I've just set up a karma branch that you should be able to create a PR for. Thanks :)

tgvashworth commented 8 years ago

@thelambdaparty https://github.com/phuu/fetch-engine/pull/54