Skip to content

Commit

Permalink
fix tests express compressing assets
Browse files Browse the repository at this point in the history
  • Loading branch information
sejas committed Oct 16, 2024
1 parent 2dbb1a5 commit a73938c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/wp-now/src/start-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export async function startServer(
);
}
const app = express();
app.use(compression({ filter: shouldCompress }));
app.use(compression({ filter: shouldCompress, threshold: 0 }));
app.use(addTrailingSlash('/wp-admin'));
const port = await portFinder.getOpenPort();
const { php, options: wpNowOptions } = await startWPNow(options);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Test Page that should be compressed</title>
</head>
</html>
2 changes: 1 addition & 1 deletion packages/wp-now/src/tests/wp-now.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ describe('Test starting different modes', () => {
* Test that startServer compresses the text files correctly.
*/
test.each([
['html', ''],
['html', '/wp-content/themes/theme-with-assets/page.html'],
['css', '/wp-content/themes/theme-with-assets/style.css'],
[
'javascript',
Expand Down

0 comments on commit a73938c

Please sign in to comment.