A games launcher for GOG, Amazon and Epic Games for Linux, Windows and macOS.
TypeScript amazon-primeelectronepic-games-launcherepic-games-storeepic-storegaminggoggog-galaxyheroic-games-launcherlinuxplay-gamesprotonsteamwine
import { serializeInstallInfoError } from '../utils'
describe('serializeInstallInfoError', () => {
it('keeps an Error message', () => {
expect(serializeInstallInfoError(new Error('gogdl exited with 1'))).toBe(
'gogdl exited with 1'
)
})
it('keeps a string', () => {
expect(serializeInstallInfoError('no credentials')).toBe('no credentials')
})
it('serializes a plain object', () => {
expect(serializeInstallInfoError({ code: 1, detail: 'bad manifest' })).toBe(
'{"code":1,"detail":"bad manifest"}'
)
})
it('falls back to Unknown error', () => {
expect(serializeInstallInfoError(undefined)).toBe('Unknown error')
expect(serializeInstallInfoError({})).toBe('Unknown error')
})
})