import assert from 'node:assert/strict' import { test } from 'vitest' import { appExecutionAliasApplications, appExecutionAliasExtensions, xmlAttribute } from './before-build.mjs' test('one MSIX extension consumes the launchers declared by the payload', () => { const names = ['custom-cli', 'another-cli'] const xml = appExecutionAliasExtensions(names) assert.equal((xml.match(/ { const xml = appExecutionAliasApplications(['odd"&' }) const values = [...xml.matchAll(/="([^"]*)"/g)].map((m) => m[1].replace(/&#\d+;/g, '')) assert.ok(values.length > 0 && values.every((v) => !/[&<>"']/.test(v)), xml) assert.ok(xml.includes('DisplayName="Hermes & "Friends" <beta>"')) assert.ok(xml.includes('Alias="odd"&<name.exe"')) assert.equal(xmlAttribute('plain-name'), 'plain-name') })