From 93b85b662934b8cb45113d55f738531b623ce866 Mon Sep 17 00:00:00 2001 From: James Tsay Date: Thu, 2 Jan 2025 11:39:27 -0800 Subject: [PATCH] Update tests --- test/scripts/utils.test.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/test/scripts/utils.test.js b/test/scripts/utils.test.js index 7979dc28..9d846344 100644 --- a/test/scripts/utils.test.js +++ b/test/scripts/utils.test.js @@ -1,10 +1,15 @@ -import { setLibs, getLibs } from '../../acrobat/scripts/utils'; -import * as sinon from 'sinon'; +/* eslint-disable compat/compat */ import { expect } from '@esm-bundle/chai'; +import { setLibs } from '../../acrobat/scripts/utils.js'; -describe('Test utils.js', async () => { - it('tests setLibs', async () => { - const libs = setLibs('/lib'); - expect(libs).to.equal('https://main--milo--adobecom.hlx.live/libs'); +describe('Test utils.js', () => { + it('tests setLibs with hlx domain', () => { + const libs = setLibs('/lib', new URL('https://stage--dc--adobecom.hlx.live?milolibs=test')); + expect(libs).to.equal('https://test--milo--adobecom.hlx.live/libs'); + }); + + it('tests setLibs with aem domain', () => { + const libs = setLibs('/lib', new URL('https://stage--dc--adobecom.aem.live?milolibs=test')); + expect(libs).to.equal('https://test--milo--adobecom.aem.live/libs'); }); });