forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-scripts-publish.test.mjs
More file actions
30 lines (26 loc) · 1.09 KB
/
Copy pathbuild-scripts-publish.test.mjs
File metadata and controls
30 lines (26 loc) · 1.09 KB
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
import { readFileSync } from 'fs'
import { resolve } from 'path'
import { describe, it, expect } from 'vitest'
// electron-builder.config.mjs declares a `publish` block (GitHub provider), so
// electron-builder auto-publishes whenever it detects CI — and then dies with
// "GitHub Personal Access Token is not set" in lanes that have no token.
// `build:linux` shipped without the flag and turned the Desktop Windows CI
// Linux job red on main. Every platform build command must pass it.
describe('electron-builder package scripts', () => {
const scripts = JSON.parse(
readFileSync(resolve(import.meta.dirname, '../package.json'), 'utf8')
).scripts
const platformBuilds = Object.entries(scripts).filter(
([, cmd]) => cmd.includes('electron-builder ') && /\s--(win|mac|linux)\b/.test(cmd)
)
it('covers every platform target', () => {
expect(platformBuilds.map(([name]) => name).sort()).toEqual([
'build:linux',
'build:mac',
'build:win'
])
})
it.each(platformBuilds)('%s passes --publish never', (_name, cmd) => {
expect(cmd).toContain('--publish never')
})
})