mirror of
https://github.com/nestriness/nestri.git
synced 2026-11-03 22:22:39 +02:00
/download/windows and /download/linux redirect to a one-minute signed URL for the current desktop app, from the same private bucket as the host agent, so a download page can link to them once and every download still passes through the API. Which version they hand out is a constant bumped by a commit after a release is published, as the host installer's is. /desktop.sh installs it on Linux for the calling user: one binary in ~/.local/bin and a launcher entry, no root.
23 lines
813 B
TypeScript
23 lines
813 B
TypeScript
import { describe, expect, test } from 'bun:test';
|
|
|
|
import { app } from '../app/index';
|
|
|
|
describe('the desktop app download', () => {
|
|
test('the Linux installer is served as a script', async () => {
|
|
const res = await app.request('/desktop.sh');
|
|
expect(res.status).toBe(200);
|
|
expect(res.headers.get('content-type')).toContain('shellscript');
|
|
expect(await res.text()).toContain('/download/linux');
|
|
});
|
|
|
|
test('a platform that is not offered is not found', async () => {
|
|
expect((await app.request('/download/macos')).status).toBe(404);
|
|
});
|
|
|
|
test('a desktop asset is a known component', async () => {
|
|
// No bucket in tests: the route got past its allow-list to the config check.
|
|
const res = await app.request('/install/desktop/0.1.0/Nestri.exe');
|
|
expect([302, 503]).toContain(res.status);
|
|
});
|
|
});
|