mirror of
https://github.com/selfxyz/self.git
synced 2026-02-21 03:00:36 -05:00
* feat: improve deployment tooling * cr feedback * for temp testing * clean build artifacts after deploy * add deploy source * uncomment ios commands * Add tests for minor deployment fixes (#750) * Add test coverage for deployment scripts and Fastfile * format * increase github check to 5 minutes
49 lines
1.5 KiB
JavaScript
49 lines
1.5 KiB
JavaScript
const { describe, it } = require('node:test');
|
|
const assert = require('node:assert');
|
|
const child_process = require('child_process');
|
|
|
|
describe('performIOSBuildCleanup', () => {
|
|
it('executes cleanup script for ios', () => {
|
|
const deploy = require('../mobile-deploy-confirm.cjs');
|
|
let called = null;
|
|
const original = child_process.execSync;
|
|
deploy._setExecSync(cmd => {
|
|
called = cmd;
|
|
});
|
|
deploy.performIOSBuildCleanup('ios');
|
|
deploy._setExecSync(original);
|
|
assert(called && called.includes('cleanup-ios-build.sh'));
|
|
});
|
|
|
|
it('does nothing for android', () => {
|
|
const deploy = require('../mobile-deploy-confirm.cjs');
|
|
let called = false;
|
|
const original = child_process.execSync;
|
|
deploy._setExecSync(() => {
|
|
called = true;
|
|
});
|
|
deploy.performIOSBuildCleanup('android');
|
|
deploy._setExecSync(original);
|
|
assert.strictEqual(called, false);
|
|
});
|
|
});
|
|
|
|
describe('executeLocalFastlaneDeployment', () => {
|
|
it('invokes cleanup after deployment', async () => {
|
|
const deploy = require('../mobile-deploy-confirm.cjs');
|
|
deploy._setExecSync(() => {});
|
|
|
|
let cleanupCalled = false;
|
|
const originalCleanup = deploy.performIOSBuildCleanup;
|
|
deploy._setPerformIOSBuildCleanup(() => {
|
|
cleanupCalled = true;
|
|
});
|
|
|
|
await deploy.executeLocalFastlaneDeployment('ios');
|
|
|
|
deploy._setPerformIOSBuildCleanup(originalCleanup);
|
|
deploy._setExecSync(child_process.execSync);
|
|
assert.strictEqual(cleanupCalled, true);
|
|
});
|
|
});
|