Skip to content

Commit

Permalink
another attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
asafkorem committed Sep 22, 2024
1 parent a3d3129 commit 52c3e8f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions detox/test/e2e/utils/snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ async function expectViewHierarchySnapshotToMatch(viewHierarchy, snapshotName) {
async function expectSnapshotToMatch(value, snapshotName, _ignoreWhiteSpace = true) {
const snapshotPath = `./e2e/assets/${snapshotName}.${rnMinorVer}.${device.getPlatform()}.txt`;

await execSync(`git checkout -b snapshot-${snapshotName} || git checkout snapshot-${snapshotName} && git rebase master`);
await execSync('git fetch origin');
await execSync(`git checkout -b snapshot-${snapshotName} || git checkout snapshot-${snapshotName}`);

await fs.writeFile(snapshotPath, value, 'utf8');

await execSync(`git add ${snapshotPath}`);
await execSync(`git commit -m "snapshot ${snapshotName}"`);
// set upstream to origin
await execSync(`git push --set-upstream origin snapshot-${snapshotName}`);
// print filename and its contents:
console.log(`Snapshot file: ${snapshotPath}`);
console.log(value);
}

module.exports = {
Expand Down

0 comments on commit 52c3e8f

Please sign in to comment.