-
-
Notifications
You must be signed in to change notification settings - Fork 195
/
test.js
53 lines (43 loc) · 1.44 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import path from 'node:path';
import fs from 'node:fs';
import {fileURLToPath} from 'node:url';
import test from 'ava';
import {execa} from 'execa';
import {temporaryDirectory} from 'tempy';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
test('main', async t => {
const cwd = temporaryDirectory();
try {
await execa(path.join(__dirname, 'cli.js'), ['--identity=0', path.join(__dirname, 'fixtures/Fixture.app')], {cwd});
} catch (error) {
// Silence code signing failure
if (!error.message.includes('No suitable code signing')) {
throw error;
}
}
t.true(fs.existsSync(path.join(cwd, 'Fixture 0.0.1.dmg')));
});
test('binary plist', async t => {
const cwd = temporaryDirectory();
try {
await execa(path.join(__dirname, 'cli.js'), ['--identity=0', path.join(__dirname, 'fixtures/Fixture-with-binary-plist.app')], {cwd});
} catch (error) {
// Silence code signing failure
if (!error.message.includes('No suitable code signing')) {
throw error;
}
}
t.true(fs.existsSync(path.join(cwd, 'Fixture 0.0.1.dmg')));
});
test('app without icon', async t => {
const cwd = temporaryDirectory();
try {
await execa(path.join(__dirname, 'cli.js'), ['--identity=0', path.join(__dirname, 'fixtures/Fixture-no-icon.app')], {cwd});
} catch (error) {
// Silence code signing failure
if (!error.message.includes('No suitable code signing')) {
throw error;
}
}
t.true(fs.existsSync(path.join(cwd, 'Fixture 0.0.1.dmg')));
});