-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #220 from adobecom/bmarshal/utils-to-scripts
MWPW-152082 Utils to Scripts
- Loading branch information
Showing
17 changed files
with
65 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { expect } from '@esm-bundle/chai'; | ||
import { setLibs, LIBS } from '../../scripts/scripts.js'; | ||
|
||
describe('Libs', () => { | ||
const tests = [ | ||
['https://business.adobe.com', '/libs'], | ||
['https://business.adobe.com?milolibs=foo', '/libs'], | ||
['https://business.stage.adobe.com', 'https://main--milo--adobecom.hlx.live/libs'], | ||
['https://business.stage.adobe.com?milolibs=foo', 'https://foo--milo--adobecom.hlx.live/libs'], | ||
['https://business.stage.adobe.com?milolibs=awesome--milo--forkedowner', 'https://awesome--milo--forkedowner.hlx.live/libs'], | ||
['https://main--bacom--adobecom.hlx.page/', 'https://main--milo--adobecom.hlx.live/libs'], | ||
['https://main--bacom--adobecom.hlx.page/?milolibs=foo', 'https://foo--milo--adobecom.hlx.live/libs'], | ||
['https://main--bacom--adobecom.hlx.page/?milolibs=local', 'http://localhost:6456/libs'], | ||
['https://main--bacom--adobecom.hlx.page/?milolibs=awesome--milo--forkedowner', 'https://awesome--milo--forkedowner.hlx.live/libs'], | ||
['https://main--bacom--adobecom.hlx.live/', 'https://main--milo--adobecom.hlx.live/libs'], | ||
['https://main--bacom--adobecom.hlx.live/?milolibs=foo', 'https://foo--milo--adobecom.hlx.live/libs'], | ||
['https://main--bacom--adobecom.hlx.live/?milolibs=local', 'http://localhost:6456/libs'], | ||
['https://main--bacom--adobecom.hlx.live/?milolibs=awesome--milo--forkedowner', 'https://awesome--milo--forkedowner.hlx.live/libs'], | ||
['http://localhost:3000', 'https://main--milo--adobecom.hlx.live/libs'], | ||
['http://localhost:3000?milolibs=foo', 'https://foo--milo--adobecom.hlx.live/libs'], | ||
['http://localhost:3000?milolibs=local', 'http://localhost:6456/libs'], | ||
['http://localhost:3000?milolibs=awesome--milo--forkedowner', 'https://awesome--milo--forkedowner.hlx.live/libs'], | ||
]; | ||
|
||
tests.forEach(([url, expected]) => { | ||
it(`Sets libs for ${url}`, () => { | ||
const location = new URL(url); | ||
const libs = setLibs(location); | ||
expect(libs).to.equal(expected); | ||
}); | ||
}); | ||
|
||
it('Sets LIBS', () => { | ||
expect(LIBS).to.equal('https://main--milo--adobecom.hlx.live/libs'); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.