Skip to content

Commit

Permalink
Added SauceLabs test
Browse files Browse the repository at this point in the history
  • Loading branch information
engineforce committed Dec 26, 2016
1 parent f41114b commit a64ea4c
Show file tree
Hide file tree
Showing 6 changed files with 168 additions and 87 deletions.
2 changes: 1 addition & 1 deletion .coveralls.yml
@@ -1,2 +1,2 @@

repo_token: 4FcJ5eywSq5iHpaP6czhGiT5FUnJWSPkN
# repo_token: 4FcJ5eywSq5iHpaP6czhGiT5FUnJWSPkN
3 changes: 3 additions & 0 deletions .travis.yml
Expand Up @@ -5,3 +5,6 @@ node_js:
- "4"
- "iojs"
after_success: 'npm run coveralls'

env:
- SAUCE_USERNAME=engineforce
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -4,6 +4,8 @@ Lightweight immutable helper that allows you to continue working with POJO (Plai

[![NPM version][3]][4] [![Build Status][1]][2] [![coverage status][5]][6]

[![Sauce Test Status][7]][8]

This library is trying to solve following problems:

* Most immutable JavaScript libraries try to encapsulate the data and provide proprietary APIs to work with the data. They are more verbose than normal JavaScript syntax. E.g., map1.get('b') vs map1.b, nested2.getIn(['a', 'b', 'd']) vs nested2.a.b.d, etc.
Expand Down Expand Up @@ -355,3 +357,5 @@ expect(o2.a.b.c[1].e).toBe(o1.a.b.c[1].e);
[4]: https://badge.fury.io/js/immutable-assign
[5]: https://coveralls.io/repos/github/engineforce/ImmutableAssign/badge.svg?branch=master
[6]: https://coveralls.io/github/engineforce/ImmutableAssign?branch=master
[7]: https://saucelabs.com/browser-matrix/engineforce.svg
[8]: https://saucelabs.com/u/engineforce
222 changes: 148 additions & 74 deletions karma.conf.js
@@ -1,79 +1,153 @@
// Karma configuration
// Generated on Wed Aug 10 2016 13:14:23 GMT+1000 (AUS Eastern Standard Time)

module.exports = function(config) {
config.set({
module.exports = function (config) {

// var customLaunchers = {
// // sl_opera: {
// // base: 'SauceLabs',
// // browserName: 'opera',
// // platform: 'Windows 7',
// // version: 'latest'
// // }
// }

var customLaunchers = {
sl_ie11: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 10',
version: 'latest'
},
sl_edge: {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
platform: 'Windows 10',
version: 'latest'
},
sl_chrome: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'Windows 10',
version: 'latest'
},
sl_firefox: {
base: 'SauceLabs',
browserName: 'firefox',
platform: 'Windows 10',
version: 'latest'
},

sl_mac_chrome: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'macOS 10.12',
version: 'latest'
},
sl_mac_safari: {
base: 'SauceLabs',
browserName: 'safari',
platform: 'macOS 10.12',
version: 'latest'
},
sl_mac_firefox: {
base: 'SauceLabs',
browserName: 'firefox',
platform: 'macOS 10.12',
version: 'latest'
},

sl_ios_safari: {
base: 'SauceLabs',
browserName: 'iphone',
platform: 'iOS 10',
},
}
config.set({

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],


// list of files / patterns to load in the browser
files: [
'src/Libs/*.js',
'node_modules/lodash/lodash.js',
'src/*.js',
'spec/**/*.js'
],


// list of files to exclude
exclude: [
],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
},


// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],


// web server port
port: 9876,


// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,


// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,

sauceLabs: {
testName: 'Immutable Assign Unit Tests',
username: 'engineforce',
accessKey: '61e43f6c-d263-4843-8561-a8ca4c482b70',
startConnect: false,
build: Math.random().toString()
},
customLaunchers: customLaunchers,
browsers: Object.keys(customLaunchers),
reporters: ['dots', 'saucelabs'],

// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
//
// If browsers are not installed to the default location, you need to set the environment variable pointing to the installation path.
// E.g., SET FIREFOX_BIN="C:\Program Files (x86)\MozillaFirefox4x\firefox.exe"
// Refer to http://karma-runner.github.io/1.0/config/browsers.html
//browsers: ["Chrome", "Firefox", "IE", "PhantomJS"],

// To Run Edge, please install https://github.com/nicolasmccurdy/karma-edge-launcher manually.
//browsers: ["Edge"],
//browsers: ["Chrome", "Firefox", "IE", "Edge", "PhantomJS"],

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,

captureTimeout: 300000,
browserNoActivityTimeout: 300000,

// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',


// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],


// list of files / patterns to load in the browser
files: [
'src/Libs/*.js',
'node_modules/lodash/lodash.js',
'src/*.js',
'spec/**/*.js'
],


// list of files to exclude
exclude: [
],


// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
},


// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],


// web server port
port: 9876,


// enable / disable colors in the output (reporters and logs)
colors: true,


// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,


// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,


// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
//
// If browsers are not installed to the default location, you need to set the environment variable pointing to the installation path.
// E.g., SET FIREFOX_BIN="C:\Program Files (x86)\MozillaFirefox4x\firefox.exe"
// Refer to http://karma-runner.github.io/1.0/config/browsers.html
browsers: ["Chrome", "Firefox", "IE", "PhantomJS"],

// To Run Edge, please install https://github.com/nicolasmccurdy/karma-edge-launcher manually.
//browsers: ["Edge"],
//browsers: ["Chrome", "Firefox", "IE", "Edge", "PhantomJS"],

// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,

// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
})
// Concurrency level
// how many browser should be started simultaneous
concurrency: 1
})
}
12 changes: 6 additions & 6 deletions spec/ImmutableAssignSpec.js
Expand Up @@ -238,10 +238,10 @@
}).toThrowError(TypeError, /Cannot|Can't|writable|doesn't|support|readonly/i);
expect(function () {
iassign(o1, function (o) { return o.a.b.c[0]; }, function (ci) { ci[0].d++; return ci; });
}).toThrowError(TypeError, /Cannot|read only|read-only|extensible|readonly/i);
}).toThrowError(TypeError, /Invalid|Cannot|read only|read-only|extensible|readonly/i);
expect(function () {
iassign(o1, function (o) { return o.a.b.c[0]; }, function (ci) { ci[0].g = 1; return ci; });
}).toThrowError(TypeError, /add|extensible|readonly/i);
}).toThrowError(TypeError, /Invalid|add|extensible|readonly/i);
expect(function () {
iassign(o1, function (o) { return o.a.b.c; }, function (ci) { ci[0].pop(); return ci; });
}).toThrowError(TypeError, /extensible|Cannot|can't|support|unable/i);
Expand Down Expand Up @@ -363,10 +363,10 @@
}).toThrowError(TypeError, /Cannot|Can't|writable|doesn't|support|readonly/i);
expect(function () {
iassign(o1, function (o) { return o.a.b.c[0]; }, function (ci) { ci[0].d++; return ci; });
}).toThrowError(TypeError, /Cannot|read only|read-only|extensible|readonly/i);
}).toThrowError(TypeError, /Invalid|Cannot|read only|read-only|extensible|readonly/i);
expect(function () {
iassign(o1, function (o) { return o.a.b.c[0]; }, function (ci) { ci[0].g = 1; return ci; });
}).toThrowError(TypeError, /add|extensible|readonly/i);
}).toThrowError(TypeError, /Invalid|add|extensible|readonly/i);
expect(function () {
iassign(o1, function (o) { return o.a.b.c; }, function (ci) { ci[0].pop(); return ci; });
}).toThrowError(TypeError, /extensible|Cannot|can't|support|unable/i);
Expand Down Expand Up @@ -396,10 +396,10 @@
}).toThrowError(TypeError, /Cannot|Can't|writable|doesn't|support|readonly/i);
expect(function () {
o2.a.b.c[0][0].d++;
}).toThrowError(TypeError, /Cannot|read only|read-only|extensible|readonly/i);
}).toThrowError(TypeError, /Invalid|Cannot|read only|read-only|extensible|readonly/i);
expect(function () {
o2.a.b.c[0][0].g = 1;
}).toThrowError(TypeError, /add|extensible|readonly/i);
}).toThrowError(TypeError, /Invalid|add|extensible|readonly/i);
expect(function () {
o2.a.b.c[0].pop();
}).toThrowError(TypeError, /extensible|Cannot|can't|support|unable/i);
Expand Down
12 changes: 6 additions & 6 deletions spec/ImmutableAssignSpec.ts
Expand Up @@ -298,11 +298,11 @@

expect(() => {
iassign(o1, function (o) { return o.a.b.c[0]; }, function (ci) { ci[0].d++; return ci; });
}).toThrowError(TypeError, /Cannot|read only|read-only|extensible|readonly/i);
}).toThrowError(TypeError, /Invalid|Cannot|read only|read-only|extensible|readonly/i);

expect(() => {
iassign(o1, function (o) { return o.a.b.c[0]; }, function (ci) { (<any>ci[0]).g = 1; return ci; });
}).toThrowError(TypeError, /add|extensible|readonly/i);
}).toThrowError(TypeError, /Invalid|add|extensible|readonly/i);

expect(() => {
iassign(o1, function (o) { return o.a.b.c; }, function (ci) { ci[0].pop(); return ci; });
Expand Down Expand Up @@ -481,11 +481,11 @@

expect(() => {
iassign(o1, function (o) { return o.a.b.c[0]; }, function (ci) { ci[0].d++; return ci; });
}).toThrowError(TypeError, /Cannot|read only|read-only|extensible|readonly/i);
}).toThrowError(TypeError, /Invalid|Cannot|read only|read-only|extensible|readonly/i);

expect(() => {
iassign(o1, function (o) { return o.a.b.c[0]; }, function (ci) { (<any>ci[0]).g = 1; return ci; });
}).toThrowError(TypeError, /add|extensible|readonly/i);
}).toThrowError(TypeError, /Invalid|add|extensible|readonly/i);

expect(() => {
iassign(o1, function (o) { return o.a.b.c; }, function (ci) { ci[0].pop(); return ci; });
Expand Down Expand Up @@ -527,11 +527,11 @@

expect(() => {
o2.a.b.c[0][0].d++;
}).toThrowError(TypeError, /Cannot|read only|read-only|extensible|readonly/i);
}).toThrowError(TypeError, /Invalid|Cannot|read only|read-only|extensible|readonly/i);

expect(() => {
(<any>o2.a.b.c[0][0]).g = 1;
}).toThrowError(TypeError, /add|extensible|readonly/i);
}).toThrowError(TypeError, /Invalid|add|extensible|readonly/i);

expect(() => {
o2.a.b.c[0].pop();
Expand Down

0 comments on commit a64ea4c

Please sign in to comment.