Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Dec 10, 2023
1 parent 878b71b commit 118b9f1
Showing 1 changed file with 4 additions and 30 deletions.
34 changes: 4 additions & 30 deletions packages/kit/test/apps/basics/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,39 +645,13 @@ test.describe('$app/paths', () => {
test('includes paths', async ({ page, javaScriptEnabled }) => {
await page.goto('/paths');

if (javaScriptEnabled) {
expect(await page.innerHTML('pre')).toBe(
JSON.stringify({
base: '',
assets: ''
})
);
} else {
expect(await page.innerHTML('pre')).toBe(
JSON.stringify({
base: '.',
assets: '.'
})
);
}
let base = javaScriptEnabled ? '' : '.';
expect(await page.innerHTML('pre')).toBe(JSON.stringify({ base, assets: base }));

await page.goto('/paths/deeply/nested');

if (javaScriptEnabled) {
expect(await page.innerHTML('pre')).toBe(
JSON.stringify({
base: '',
assets: ''
})
);
} else {
expect(await page.innerHTML('pre')).toBe(
JSON.stringify({
base: '../..',
assets: '../..'
})
);
}
base = javaScriptEnabled ? '' : '../..';
expect(await page.innerHTML('pre')).toBe(JSON.stringify({ base, assets: base }));
});

// some browsers will re-request assets after a `pushState`
Expand Down

0 comments on commit 118b9f1

Please sign in to comment.