@percy/core
Advanced tools
Comparing version 1.0.0-beta.8 to 1.0.0-beta.9
@@ -125,2 +125,13 @@ "use strict"; | ||
return _logger.default.loglevel(level); | ||
} // Snapshot server API address | ||
apiAddress() { | ||
var _this$server, _address; | ||
let { | ||
address | ||
} = ((_this$server = this.server) === null || _this$server === void 0 ? void 0 : _this$server.address()) || {}; | ||
address = ((_address = address) === null || _address === void 0 ? void 0 : _address.includes(':')) ? `[${address}]` : address; | ||
return address && `http://${address}:${this.port}/percy`; | ||
} // Returns a boolean indicating if this instance is running. | ||
@@ -163,7 +174,7 @@ | ||
} catch (error) { | ||
var _this$server; | ||
var _this$server2; | ||
// on error, close any running browser or server | ||
await this.discoverer.close(); | ||
(_this$server = this.server) === null || _this$server === void 0 ? void 0 : _this$server.close(); // throw an easier-to understand error when the port is taken | ||
(_this$server2 = this.server) === null || _this$server2 === void 0 ? void 0 : _this$server2.close(); // throw an easier-to understand error when the port is taken | ||
@@ -183,3 +194,3 @@ if (error.code === 'EADDRINUSE') { | ||
if (this.isRunning() && !_classPrivateFieldGet(this, _stopping)) { | ||
var _this$server2; | ||
var _this$server3; | ||
@@ -207,3 +218,3 @@ _classPrivateFieldSet(this, _stopping, true); | ||
(_this$server2 = this.server) === null || _this$server2 === void 0 ? void 0 : _this$server2.close(); | ||
(_this$server3 = this.server) === null || _this$server3 === void 0 ? void 0 : _this$server3.close(); | ||
await this.discoverer.close(); | ||
@@ -210,0 +221,0 @@ |
@@ -8,9 +8,14 @@ "use strict"; | ||
// Returns a promise that resolves when the `count` function returns `0`. If | ||
// `count` returns non-zero, will check again after `timeout`. The `count` | ||
// function must eventually return `0` or the promise will never resolve. | ||
function idle(count, timeout = 10) { | ||
return new Promise(resolve => function check() { | ||
if (count() === 0) resolve();else setTimeout(check, timeout); | ||
// Returns a promise that resolves when the `count` function returns `0`. If `count` returns | ||
// non-zero, it will check again after `interval`. The `count` function must eventually return `0` | ||
// or the promise will never resolve. If a timeout is provided, the check will be run again before | ||
// resolving to ensure `count` still returns `0` after the timeout. | ||
function idle(count, timeout = 0, interval = 10) { | ||
return new Promise(resolve => function check(last) { | ||
if (count() === 0) { | ||
if (!timeout || last) resolve();else setTimeout(check, timeout, true); | ||
} else { | ||
setTimeout(check, interval); | ||
} | ||
}()); | ||
} |
{ | ||
"name": "@percy/core", | ||
"version": "1.0.0-beta.8", | ||
"version": "1.0.0-beta.9", | ||
"license": "MIT", | ||
@@ -27,5 +27,5 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@percy/client": "^1.0.0-beta.8", | ||
"@percy/dom": "^1.0.0-beta.8", | ||
"@percy/logger": "^1.0.0-beta.8", | ||
"@percy/client": "^1.0.0-beta.9", | ||
"@percy/dom": "^1.0.0-beta.9", | ||
"@percy/logger": "^1.0.0-beta.9", | ||
"body-parser": "^1.19.0", | ||
@@ -42,3 +42,3 @@ "cors": "^2.8.5", | ||
}, | ||
"gitHead": "6015850e7c20c130d625fcb327b10d7513b35707" | ||
"gitHead": "57a2eeb90c7f5cdf8827c78be1e5c12df581f4b5" | ||
} |
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
54077
1153
Updated@percy/client@^1.0.0-beta.9
Updated@percy/dom@^1.0.0-beta.9
Updated@percy/logger@^1.0.0-beta.9