Writing testling-ci tests is super easy. The only thing your test runner needs to do is to produce TAP output on console.log or process.stdout.

Let's create a new node module called testling-ci-test-example and let's add cross-browser tests to it. Once the tests run, you get a badge like this that shows in which browsers your code works:


If you click the badge you go to the test status page.

First, let's create index.js that exports a few functions, some of which work in some browsers and fail in others:

// doesn't work in IE<9
//
exports.timesTwo = function (list) {
    return list.map(function (x) { return x*2 });
}

// works everywhere
//
exports.timesThree = function (list) {
    var ret = [];
    for (var i = 0; i < list.length; i++) {
        ret[i] = list[i]*3;
    }
    return ret;
}

Now let's write tests for this module. We'll put tests in tests/test.js:

var test = require('tape');
var exampleLib = require('../index.js');

test('timesTwo test', function (t) {
  t.plan(1);
  t.deepEqual(exampleLib.timesTwo([1,2,3]), [2,4,6]);
});

test('timesThree test', function (t) {
  t.plan(1);
  t.deepEqual(exampleLib.timesThree([1,2,3]), [3,6,9]);
});

The tests use tape module that console.log's TAP formatted output.

Now let's add testling field to package.json:

"testling" : {
    "files" : "test/*.js",
    "browsers" : {
        "ie" : [ 6, 7, 8, 9, 10 ],
        "ff" : [ 3.5, 10, 15.0, 16.0, 17.0 ],
        "chrome" : [ 10, 20, 21, 22, 23 ],
        "safari" : [ 5.1 ],
        "opera" : [ 10, 11, 12 ]
    }
}

Finally, let's setup the github hook and point it to git.testling.com. First go to the settings of the repository,

Next, go to the service hooks,

Then, choose WebHook URLs,

Finally, type git.testling.com in the webhook URL field and press update settings,

And we're done. If we visit http://ci.testling.com/pkrumins/testling-ci-test-example we'll see the badge and which browsers the tests succeeded and in which browsers the code failed:

We can instantly see that the code fails in IE6, IE7, and IE8 because these versions of IE don't have Array.prototype.map, and that the code works everywhere else. So awesome!

For more information about testling-ci see ci.testling.com.


ci.testling.com

About Browserling

Our mission at Browserling Inc is to make the developers' life easier. Follow us on twitter for updates - @browserling, @testling, @substack, @pkrumins.

Comments

Nephi Wright Permalink
January 20, 2013, 16:52

I would like to explore browserling with a Jenkins/Mercurial build and test environment. Further, the code we write doesn't go public except to our clients, so it would be ideal if we could set it up on our servers or privately.

Is any of this in the future of browserling?

January 20, 2013, 20:15

Sorry, I don't know about that. Please ask my co-founder @substack. He knows more about various test environments.

September 03, 2013, 17:07

thanks

joson Permalink
October 29, 2013, 07:23

Superb! Generally I never read whole articles but the way you wrote this information is simply amazing and this kept my interest in reading and I enjoyed it.WatchohThanks!!

peggyd Permalink
December 20, 2013, 05:45

Writing testling-ci tests is super easy. The only thing your test runner needs to do is to produce TAP output on console.log or process.stdout. writing is really an art. Not all students have the same writing skill. So most of the students buy custom essays online. It is also a good option. Online writers provides outstanding essays.

jenniffer07 Permalink
May 06, 2014, 07:12

what i did was i just used some essay writing service usa and that was really helped me to prepare for CI tests...

August 20, 2014, 13:10

It's really a great article, Given plenty information and facts with it, These kind of information articles keeps the people interest on the web site, and maintain on posting about it further ...
file upload free
enjoy!

September 12, 2014, 10:28

I can see that you are an expert at your field!
I am launching a website soon, and your information will be very useful for me.
Thanks for all your help and wishing you all the success in your business.

September 12, 2014, 10:30

I just couldn't leave your website before telling you that I truly enjoyed the top quality info you present to your visitors?
Will be back again frequently to check up on new posts.

October 06, 2014, 04:57

I think you made a few rather interesting points.
Not too many people would really think about this the way you just did.
I am truly impressed that there is so much about this subject that has been revealed and you did it so nicely, with so considerably class.
Top-notch one, thank you.
Best MCX Tips.

October 06, 2014, 05:04

The piece of work is very pretty. It is rare to get high quality post like this.
The post is very interesting that I have bookmarked it.
MCX Tips.

October 14, 2014, 08:56

I am very much impressed by the post indeed. The post is pretty enough to understand the author's motto. I like the post which contains the proper word stuffing and good sentenced framed structure.
Androidone Phone.

October 15, 2014, 14:17

Contents of this site are very helpful thank you very much for the useful content

Kaur deep Permalink
December 04, 2014, 03:33

Excellent and knowledgeable links and post.thanks for sharing.
Now, The Time has come for the Happy New Year 2015. It wil bring a lot fo happinesin our life.
Happy New Year 2015
And I am sure, You wil anjoy this new year day with yoru fiends and wil send some images wishes,
New Year 2015

Happy New Year 2015 Wishes
Greetings to yoru close ones, Your friends, You lover, etc..
Happy New Year 2015 Images
Even I am waititng for that day, because it just changes our life.
Happy New Year 2015 Greetings

Happy New Year 2015 SMS
So, That's why I am commenting here to wish you a very happy new year.
Happy New Year 2015 Messages
I hope this New year 2015 wil bring success to your website. But before that Merry Christmas is coming.
Merry Christmas Quotes
It is also a big event for everyone.
Merry Christmas Pictures
Everyone knows that Christmas is a day when People seems to be very happy, they just leave all sadness behind.
Merry Christmas Wallpapers
And I am sure, you also enjoy this Merry Christmas day of 2014.
Christmas day Images

Christmas stocking
But if you are not looking out to enjoy this christmas, then you are missing out on a big thing, because it really brings happiness.
Merry Christmas Images

Merry Christmas 2014
So, what you are waiting for?
Merry Christmas 2015
Enjoy This Merry Christmas day. Cheers :).

December 09, 2014, 09:46

nice
a href=" http://mynycstreets.com/2014/12/download-lingaa-movie-torrentlingaa-movie-free-download/">Lingaa Movie Torrent Downl

<oad>

lingaa movie in mp4lingaa movie in hdlingaa movie in free downloadLingaa Movie download in torrentfree download lingaa movie
diggnice article

Diana Permalink
December 17, 2014, 16:12

This article is quite helpful and informative too. I enjoyed a lot. Thanks for sharing such a great article.

Beautiful Christmas Quotes for your friends and family...
christmas quotes
Christmas Messages for Whatsapp

Best Christmas Greetings for your friends and family...
christmas greeting
christmas wishes

What to Write in Christmas Card....... Check out best Christmas Greeting Card Words
What to Write in Christmas Card

Get Beautiful and Unique Christmas Wallpapers for free
free christmas wallpaper
christmas tree decorating ideas

Thanks for sharing such a great article.

Leave a new comment

(why do I need your e-mail?)

(Your twitter name, if you have one. (I'm @pkrumins, btw.))

Type the word "cdrom_362": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.

Advertisements