Skip to content

Commit

Permalink
test(@astrojs/node) wait for server listening in trailing-slash tests (
Browse files Browse the repository at this point in the history
…withastro#10694)

* test(@astrojs/node) wait for server listening in trailing-slash tests

* fix missing waitServerListen

* fix import statement

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
  • Loading branch information
2 people authored and PeterDraex committed Apr 23, 2024
1 parent 4595e23 commit 2ee640a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/integrations/node/test/prerender.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ describe('Hybrid rendering', () => {
const { startServer } = await load();
let res = startServer();
server = res.server;
await waitServerListen(server.server);
});

after(async () => {
Expand Down
8 changes: 7 additions & 1 deletion packages/integrations/node/test/trailing-slash.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as assert from 'node:assert/strict';
import { after, before, describe, it } from 'node:test';
import * as cheerio from 'cheerio';
import nodejs from '../dist/index.js';
import { loadFixture } from './test-utils.js';
import { loadFixture, waitServerListen } from './test-utils.js';

/**
* @typedef {import('../../../astro/test/test-utils').Fixture} Fixture
Expand Down Expand Up @@ -36,6 +36,7 @@ describe('Trailing slash', () => {
const { startServer } = await load();
let res = startServer();
server = res.server;
await waitServerListen(server.server);
});

after(async () => {
Expand Down Expand Up @@ -101,6 +102,7 @@ describe('Trailing slash', () => {
const { startServer } = await load();
let res = startServer();
server = res.server;
await waitServerListen(server.server);
});

after(async () => {
Expand Down Expand Up @@ -169,6 +171,7 @@ describe('Trailing slash', () => {
const { startServer } = await load();
let res = startServer();
server = res.server;
await waitServerListen(server.server);
});

after(async () => {
Expand Down Expand Up @@ -227,6 +230,7 @@ describe('Trailing slash', () => {
const { startServer } = await load();
let res = startServer();
server = res.server;
await waitServerListen(server.server);
});

after(async () => {
Expand Down Expand Up @@ -288,6 +292,7 @@ describe('Trailing slash', () => {
const { startServer } = await load();
let res = startServer();
server = res.server;
await waitServerListen(server.server);
});

after(async () => {
Expand Down Expand Up @@ -364,6 +369,7 @@ describe('Trailing slash', () => {
const { startServer } = await load();
let res = startServer();
server = res.server;
await waitServerListen(server.server);
});

after(async () => {
Expand Down

0 comments on commit 2ee640a

Please sign in to comment.