@percy/client
Advanced tools
Comparing version 1.6.4 to 1.7.0
@@ -190,6 +190,6 @@ import fs from 'fs'; | ||
}, onProgress) { | ||
if (commit && !project) { | ||
if (!project && commit) { | ||
throw new Error('Missing project path for commit'); | ||
} else if (!commit && !build) { | ||
throw new Error('Missing build ID or commit SHA'); | ||
} else if (!project && !build) { | ||
throw new Error('Missing project path or build ID'); | ||
} else if (project) { | ||
@@ -199,8 +199,14 @@ validateProjectPath(project); | ||
commit || (commit = this.env.git.sha); | ||
if (!build && !commit) throw new Error('Missing build commit'); | ||
let sha = commit && (git(`rev-parse ${commit}`) || commit); | ||
let fetchData = async () => build ? (await this.getBuild(build)).data : (await this.getBuilds(project, { | ||
sha | ||
})).data[0]; | ||
let fetchData = async () => { | ||
var _await$this$getBuilds; | ||
return build ? (await this.getBuild(build)).data : (_await$this$getBuilds = (await this.getBuilds(project, { | ||
sha | ||
})).data) === null || _await$this$getBuilds === void 0 ? void 0 : _await$this$getBuilds[0]; | ||
}; | ||
this.log.debug(`Waiting for build ${build || `${project} (${commit})`}...`); // recursively poll every second until the build finishes | ||
@@ -218,3 +224,3 @@ | ||
} else if (Date.now() - t >= timeout) { | ||
throw new Error('Timeout exceeded without an update'); | ||
throw new Error(state == null ? 'Build not found' : 'Timeout exceeded with no updates'); | ||
} // call progress every update after the first update | ||
@@ -221,0 +227,0 @@ |
{ | ||
"name": "@percy/client", | ||
"version": "1.6.4", | ||
"version": "1.7.0", | ||
"license": "MIT", | ||
@@ -34,6 +34,6 @@ "repository": { | ||
"dependencies": { | ||
"@percy/env": "1.6.4", | ||
"@percy/logger": "1.6.4" | ||
"@percy/env": "1.7.0", | ||
"@percy/logger": "1.7.0" | ||
}, | ||
"gitHead": "651c0fad62f128053723f9b8d565c69496dc51e4" | ||
"gitHead": "f1418fb1effdaad2d32c65d1a358282ab1f9ec32" | ||
} |
@@ -82,13 +82,15 @@ import EventEmitter from 'events'; | ||
spyOn(http, 'get').and.callFake((...a) => new MockRequest(null, ...a).end()); | ||
mockRequests.spies = new Map(); | ||
} | ||
let any = jasmine.anything(); | ||
let match = o => o.hostname === hostname && | ||
(o.path ?? o.pathname).startsWith(pathname); | ||
let match = o => o.hostname === hostname && (o.path ?? o.pathname).startsWith(pathname); | ||
let reply = jasmine.createSpy('reply').and.callFake(defaultReply); | ||
let spies = mockRequests.spies.get(baseUrl) ?? {}; | ||
http.request.withArgs({ asymmetricMatch: match }) | ||
.and.callFake((...a) => new MockRequest(reply, ...a)); | ||
http.get.withArgs({ asymmetricMatch: u => match(new URL(u)) }, any, any) | ||
.and.callFake((...a) => new MockRequest(reply, ...a).end()); | ||
spies.request = spies.request ?? http.request.withArgs({ asymmetricMatch: match }); | ||
spies.request.and.callFake((...a) => new MockRequest(reply, ...a)); | ||
spies.get = spies.get ?? http.get.withArgs({ asymmetricMatch: u => match(new URL(u)) }, any, any); | ||
spies.get.and.callFake((...a) => new MockRequest(reply, ...a).end()); | ||
mockRequests.spies.set(baseUrl, spies); | ||
@@ -95,0 +97,0 @@ return reply; |
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
35803
752
+ Added@percy/env@1.7.0(transitive)
+ Added@percy/logger@1.7.0(transitive)
- Removed@percy/env@1.6.4(transitive)
- Removed@percy/logger@1.6.4(transitive)
Updated@percy/env@1.7.0
Updated@percy/logger@1.7.0