Skip to content

Commit

Permalink
Reverting back
Browse files Browse the repository at this point in the history
  • Loading branch information
rishigupta1599 committed Feb 19, 2024
1 parent ff3980b commit cef261f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/core/src/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,10 @@ export function createSnapshotsQueue(percy) {
.handle('task', async function*({ resources, ...snapshot }) {
let { name, meta } = snapshot;

const errorMessage = percy.client.screenshotFlow === 'automate' ? 'automate' : 'App Percy';
if (percy.client.buildType !== percy.client.screenshotFlow) {
throw new Error(`Cannot run ${errorMessage} screenshots in ${percy.client.buildType} project. Please use ${errorMessage} project token`);
if (percy.client.screenshotFlow === 'automate' && percy.client.buildType !== 'automate') {
throw new Error(`Cannot run automate screenshots in ${percy.client.buildType} project. Please use automate project token`);
} else if (percy.client.screenshotFlow === 'app' && percy.client.buildType !== 'app') {
throw new Error(`Cannot run App Percy screenshots in ${percy.client.buildType} project. Please use App Percy project token`);
}
// yield to evaluated snapshot resources
snapshot.resources = typeof resources === 'function'
Expand Down

0 comments on commit cef261f

Please sign in to comment.