Files
Jeffrey PosnickandGitHub 7d4c4434a4 Enable prettier (#2929)
* Deps and config

* Prettier output

* Update hardcoded file sizes

* More file size updates
2021-08-26 14:57:20 -07:00

42 lines
1.0 KiB
JavaScript

/*
Copyright 2018 Google LLC
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/
const expect = require('chai').expect;
const {
getStringDetails,
} = require('../../../../packages/workbox-build/build/lib/get-string-details');
describe(`[workbox-build] lib/get-string-details.js`, function () {
it(`should return the expected details`, function () {
const inputToExpectedDetails = new Map([
[
['/url-one', 'first-one'],
{
file: '/url-one',
hash: 'e725107146e32e2e7e75feaa303b7fbc',
size: 9,
},
],
[
['/url-two', 'another-string'],
{
file: '/url-two',
hash: '7fb80c5fad3565fd6ce3d9f61a53c659',
size: 14,
},
],
]);
for (const [[url, string], expectedDetails] of inputToExpectedDetails) {
const details = getStringDetails(url, string);
expect(details).to.eql(expectedDetails);
}
});
});