Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
benjervis committed Dec 17, 2024
1 parent 20d9db3 commit 3ce9b1d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/utils/domain-sharding/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ describe('domain sharding helpers', () => {

const result = shardUrlUnchecked(testBundle, 5);

assert.equal(result, 'http://localhost/assets/');
assert.equal(result, 'http://localhost-3/assets/');
});

it('should handle domains with ports', () => {
const testBundle = 'http://localhost:8081/assets/testBundle.123abc.js';

const result = shardUrlUnchecked(testBundle, 5);

assert.equal(result, 'http://localhost:8081/assets/');
assert.equal(result, 'http://localhost-3:8081/assets/');
});
});

Expand All @@ -52,7 +52,10 @@ describe('domain sharding helpers', () => {

const result = shardUrl(testBundle, 5);

assert.equal(result, 'https://bundle-shard-0.assets.example.com/assets/');
assert.equal(
result,
'https://bundle-shard-0.assets.example.com/assets/test-bundle.123abc.js',
);
});

it('should not add a shard if the window property is not set', () => {
Expand Down

0 comments on commit 3ce9b1d

Please sign in to comment.