Skip to content

Commit

Permalink
debugging puppet test for the MacOS zip artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
davemfish committed Oct 2, 2020
1 parent 51e2f64 commit 1c83286
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"build": {
"extraResources": [
{
"from":"build/invest",
"to":"invest"
"from": "build/invest",
"to": "invest"
}
],
"appId": "NaturalCapitalProject.Invest.Desktop",
Expand Down
11 changes: 8 additions & 3 deletions tests/binary_tests/puppet.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@ import path from 'path';
import glob from 'glob';
import fetch from 'node-fetch';
import { remote } from 'electron';
import { spawn } from 'child_process';
import { spawn, spawnSync } from 'child_process';
import puppeteer from 'puppeteer-core';
import { getDocument, queries, waitFor } from 'pptr-testing-library';

import { cleanupDir } from '../../src/utils'

jest.setTimeout(25000) // I observe this test takes ~15 seconds.

const PORT = 9009;
const binaryPath = glob.sync('./dist/invest-desktop_*')[0]

let binaryPath = glob.sync('./dist/invest-desktop_*')[0]
if (binaryPath.endsWith('.zip')) {
// The MacOS exe needs to be extracted first
spawnSync('unzip', [binaryPath, '-d', './dist/'])
binaryPath = glob.sync('./dist/invest-desktop_*.app')[0]
}
console.log(binaryPath)
fs.accessSync(binaryPath, fs.constants.X_OK)
const TMP_DIR = fs.mkdtempSync('tests/data/_')
Expand Down

0 comments on commit 1c83286

Please sign in to comment.