From 05945575e871bd4084c3a2459974cfb524fdf4b8 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Mon, 9 Jul 2018 15:54:14 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20test=20for=20retailclient?= =?UTF-8?q?=5Fswtor=20announce=20url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ssn/verify/verifySolidpkg.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ssn/verify/verifySolidpkg.ts b/src/ssn/verify/verifySolidpkg.ts index 6065e0f..6fa8b84 100644 --- a/src/ssn/verify/verifySolidpkg.ts +++ b/src/ssn/verify/verifySolidpkg.ts @@ -5,8 +5,13 @@ export default function verifySolidpkg(file: ISolid, { product, from, to }: {pro if (typeof file['creation date'] !== 'number') { throw new Error(`Expected creation date to be a number but it was "${file['creation date']}".`); } - if (file.announce.match(/^http:\/\/Tracker22\.[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}\.automated\.(tel\.swtor\.com:80|ssntracker\.int:80|snxd\.com:2500)\/$/) === null) { - throw new Error(`Expected announce URL but it was "${file.announce}".`); + const announceGeneral = /^http:\/\/Tracker22\.[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}\.automated\.(tel\.swtor\.com|ssntracker\.int):80\/$/; + const announceRetailclientSwtor = /^http:\/\/Tracker14\.[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}\.automated\.snxd\.com:2500\/$/; + if (file.announce.match(announceGeneral) === null && product !== 'retailclient_swtor') { + throw new Error(`Expected general announce URL but it was "${file.announce}".`); + } + if (file.announce.match(announceRetailclientSwtor) === null && product === 'retailclient_swtor') { + throw new Error(`Expected retailclient announce URL but it was "${file.announce}".`); } if (file.title !== `${product}: ${from}to${to}`) { throw new Error(`Expected title "${product}: ${from}to${to}" but it was "${file.title}".`);