panic-client
Advanced tools
Comparing version 0.2.0 to 0.3.0
# Changelog | ||
## v0.3.0 | ||
### Added | ||
- Shared job state with `this.set` and `this.get`. | ||
### Removed | ||
- `panic.js` build from git. It'll still be published on npm. | ||
## v0.2.0 | ||
Breaking changes: | ||
- The `done` callback is now the 1st parameter passed to peers instead of the second. | ||
- Variable injection no longer happens by default, and the flag has changed to `'@scope'`. | ||
### Changed | ||
- The `done` callback is now the 1st parameter passed to peers instead of the second. | ||
- Variable injection no longer happens by default, and the flag has changed to `'@scope'`. | ||
Improvement: a number of things have changed to allow for IE6 compatibility (polyfill of arguments, function.length, and a function expression fix in `eval`). | ||
### Added | ||
- IE6 compatibility by adding polyfills (`arguments`, `function.length`, `eval` variable assignment over function expressions). | ||
## v0.1.2 | ||
Bug fix: previous version build not updated. | ||
### Fixed | ||
- Previous version build not updated. | ||
## v0.1.1 | ||
Add `platform` to the job prototype. | ||
### Added | ||
- `platform` object now accessible to jobs as `this.platform`. | ||
## v0.1.0 | ||
Initial minor release. | ||
Initial release. |
{ | ||
"name": "panic-client", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Test client for panic-server", | ||
@@ -13,3 +13,3 @@ "main": "src/index.js", | ||
"chai": "^3.5.0", | ||
"mocha": "^2.4.5", | ||
"mocha": "^3.1.0", | ||
"webpack": "^1.12.14" | ||
@@ -19,3 +19,5 @@ }, | ||
"test": "mocha", | ||
"build": "webpack --watch" | ||
"build": "webpack", | ||
"dev": "npm run build -- --watch", | ||
"prepublish": "npm run build" | ||
}, | ||
@@ -22,0 +24,0 @@ "repository": { |
@@ -6,2 +6,5 @@ /*eslint "no-eval": "off", "id-length": "off"*/ | ||
/** Shared state across all jobs.*/ | ||
var state = {}; | ||
// Function.prototype.bind | ||
@@ -80,2 +83,27 @@ require('phantomjs-polyfill'); | ||
/** | ||
* Sets a value into a shared state object. | ||
* | ||
* @param {String} key - A name for the value. | ||
* @param {Mixed} value - The variable to expose to other jobs. | ||
* @returns {Mixed} - The value you just set. | ||
*/ | ||
set: function (key, value) { | ||
state[key] = value; | ||
return value; | ||
}, | ||
/** | ||
* Looks up variables in an object shared by all jobs. | ||
* | ||
* @param {String} key - The name of the value. | ||
* @returns {Mixed} - The value, if found (otherwise `undefined`). | ||
*/ | ||
get: function (key) { | ||
if (state.hasOwnProperty(key) === false) { | ||
return undefined; | ||
} | ||
return state[key]; | ||
}, | ||
/* | ||
@@ -82,0 +110,0 @@ * Mark a test as finished. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
253128
12
8055