Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
toarm committed Aug 19, 2024
1 parent 7a8d57e commit 457a441
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions src/test/transport/SQSErrorTransport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ declare var page: Page;

describe('Test the SQSErrorTransport', () => {

const {
startMockServer,
shutdownMockServer,
verifyNoUnmatchedRequests,
createStubAsserter,
getHost
} = createMockServer();

beforeAll(async () => {
await startMockServer();
})
const {
startMockServer,
shutdownMockServer,
verifyNoUnmatchedRequests,
createStubAsserter,
getHost
} = createMockServer();

beforeAll(async () => {
await startMockServer();
})

afterAll(async () => {
await shutdownMockServer();
})
afterAll(async () => {
await shutdownMockServer();
})

afterEach(async () => {
await verifyNoUnmatchedRequests();
})
afterEach(async () => {
await verifyNoUnmatchedRequests();
})

test('SQSErrortTransport', async () => {
const asserter = await createStubAsserter("SQSErrortTransport.json");
test('SQSErrortTransport', async () => {
const asserter = await createStubAsserter("SQSErrortTransport.json");

await page.goto(getHost() + "/SQSErrorTransport.page.html", {waitUntil: 'networkidle0'});
await wait(1200); // wait more than a second for the buffering writer
await page.goto(getHost() + "/SQSErrorTransport.page.html", {waitUntil: 'networkidle0'});
await wait(1200); // wait more than a second for the buffering writer

const data = {
type: "error",
Expand All @@ -42,7 +42,8 @@ describe('Test the SQSErrorTransport', () => {
arguments: [],
url: "http://localhost:{port}/SQSErrorTransport.page.html".replace("{port}", String(asserter.getPort())),
referrer: "",
lang: "en-US"
lang: "en-US",
agent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/100.0.4889.0 Safari/537.36"
};

await asserter.verifyCallCount(1)
Expand Down

0 comments on commit 457a441

Please sign in to comment.