Skip to content

Commit

Permalink
chore: replaced test-listen with async-listen (#920)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisrice202 authored Nov 7, 2023
1 parent 8731be9 commit 30af456
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 48 deletions.
44 changes: 17 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions packages/playwright/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,13 @@
"@types/express": "^4.17.14",
"@types/mocha": "^10.0.0",
"@types/node": "^20.8.10",
"@types/test-listen": "^1.1.0",
"async-listen": "^3.0.1",
"axe-test-fixtures": "github:dequelabs/axe-test-fixtures#v1",
"chai": "^4.3.6",
"express": "^4.18.2",
"mocha": "^10.0.0",
"nyc": "^15.1.0",
"rimraf": "^5.0.5",
"test-listen": "^1.1.0",
"ts-node": "^10.9.1",
"tsup": "^7.2.0",
"typescript": "^4.8.4"
Expand Down
6 changes: 4 additions & 2 deletions packages/playwright/test/axe-playwright.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fs from 'fs';
import { chromium, ChromiumBrowser, Page } from '@playwright/test';
import express from 'express';
import type { AxeResults, Result } from 'axe-core';
import testListen from 'test-listen';
import listen from 'async-listen';
import { assert } from 'chai';
import path from 'path';
import { Server, createServer } from 'http';
Expand Down Expand Up @@ -38,7 +38,9 @@ describe('@axe-core/playwright', () => {
const app = express();
app.use(express.static(fixturesPath));
server = createServer(app);
addr = await testListen(server);
// async-listen adds trailing forward slash,
// this removes the unnecessary trailing forward slash
addr = (await listen(server)).toString().replace(/\/$/, '');
});

after(async () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/puppeteer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@types/mocha": "^10.0.0",
"@types/node": "^20.8.10",
"@types/sinon": "^10.0.13",
"@types/test-listen": "^1.1.0",
"async-listen": "^3.0.1",
"axe-test-fixtures": "github:dequelabs/axe-test-fixtures#v1",
"chai": "^4.3.6",
"cross-dirname": "^0.1.0",
Expand All @@ -47,7 +47,6 @@
"puppeteer": "19.7.3",
"sinon": "^14.0.1",
"source-map-support": "^0.5.21",
"test-listen": "^1.1.0",
"ts-node": "^10.9.1",
"tsup": "^7.2.0",
"typescript": "^4.8.4"
Expand Down
6 changes: 4 additions & 2 deletions packages/puppeteer/test/axe-puppeteer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { assert } from 'chai';
import Puppeteer, { Browser, Page } from 'puppeteer';
import { createServer, Server } from 'http';
import * as sinon from 'sinon';
import testListen from 'test-listen';
import listen from 'async-listen';
import { AxePuppeteer } from '../src/index';
import {
startServer,
Expand Down Expand Up @@ -355,7 +355,9 @@ describe('AxePuppeteer', function () {
}, 3000);
}
});
addr2 = await testListen(server2);
// async-listen adds trailing forward slash,
// this removes the unnecessary trailing forward slash
addr2 = (await listen(server2)).toString().replace(/\/$/, '');
});

after(() => {
Expand Down
6 changes: 4 additions & 2 deletions packages/puppeteer/test/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import express from 'express';
import { createServer, Server } from 'http';
import testListen from 'test-listen';
import listen from 'async-listen';
import { expect } from 'chai';
import type { PuppeteerLaunchOptions } from 'puppeteer';
import { fixturesPath } from 'axe-test-fixtures';
Expand Down Expand Up @@ -29,7 +29,9 @@ export async function startServer(): Promise<{ server: Server; addr: string }> {
const app: express.Application = express();
app.use(express.static(fixturesPath));
const server: Server = createServer(app);
const addr = await testListen(server);
// async-listen adds trailing forward slash,
// this removes the unnecessary trailing forward slash
const addr = (await listen(server)).toString().replace(/\/$/, '');

return { server, addr };
}
Expand Down
3 changes: 1 addition & 2 deletions packages/webdriverio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@types/express": "^4.17.14",
"@types/mocha": "^10.0.0",
"@types/node": "^20.8.10",
"@types/test-listen": "^1.1.0",
"async-listen": "^3.0.1",
"axe-test-fixtures": "github:dequelabs/axe-test-fixtures#v1",
"chai": "^4.3.6",
"chromedriver": "latest",
Expand All @@ -66,7 +66,6 @@
"nyc": "^15.1.0",
"rimraf": "^5.0.5",
"source-map-support": "^0.5.21",
"test-listen": "^1.1.0",
"ts-node": "^10.9.1",
"tsup": "^7.2.0",
"typescript": "^4.8.4",
Expand Down
6 changes: 4 additions & 2 deletions packages/webdriverio/test/axe-webdriverio.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as webdriverio from 'webdriverio';
import express from 'express';
import testListen from 'test-listen';
import listen from 'async-listen';
import { assert } from 'chai';
import chromedriver from 'chromedriver';
import path from 'path';
Expand Down Expand Up @@ -96,7 +96,9 @@ describe('@axe-core/webdriverio', () => {
let binaryPath;
app.use(express.static(fixturesPath));
server = createServer(app);
addr = await testListen(server);
// async-listen adds trailing forward slash,
// this removes the unnecessary trailing forward slash
addr = (await listen(server)).toString().replace(/\/$/, '');
if (
fs.existsSync(`C:/Program Files/Google/Chrome/Application/chrome.exe`)
) {
Expand Down
3 changes: 1 addition & 2 deletions packages/webdriverjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"@types/mocha": "^10.0.0",
"@types/node": "^20.8.10",
"@types/selenium-webdriver": "^4.1.5",
"@types/test-listen": "^1.1.0",
"async-listen": "^3.0.1",
"axe-test-fixtures": "github:dequelabs/axe-test-fixtures#v1",
"chai": "^4.3.6",
"chromedriver": "latest",
Expand All @@ -81,7 +81,6 @@
"nyc": "^15.1.0",
"rimraf": "^5.0.5",
"selenium-webdriver": "^4.8.1",
"test-listen": "^1.1.0",
"ts-node": "^10.9.1",
"tsup": "^7.2.0",
"typescript": "^4.8.4"
Expand Down
6 changes: 4 additions & 2 deletions packages/webdriverjs/test/axe-webdriverjs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'mocha';
import type { AxeResults, Result } from 'axe-core';
import type { WebDriver } from 'selenium-webdriver';
import express from 'express';
import testListen from 'test-listen';
import listen from 'async-listen';
import { assert } from 'chai';
import path from 'path';
import fs from 'fs';
Expand Down Expand Up @@ -44,7 +44,9 @@ describe('@axe-core/webdriverjs', () => {
const app = express();
app.use(express.static(fixturesPath));
server = createServer(app);
addr = await testListen(server);
// async-listen adds trailing forward slash,
// this removes the unnecessary trailing forward slash
addr = (await listen(server)).toString().replace(/\/$/, '');
});

beforeEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/wdio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"@wdio/local-runner": "^8.20.0",
"@wdio/mocha-framework": "^8.20.0",
"@wdio/spec-reporter": "^8.20.0",
"async-listen": "^3.0.1",
"axe-test-fixtures": "github:dequelabs/axe-test-fixtures#v1",
"chai": "^4.3.10",
"express": "^4.18.2",
"mocha": "^10.2.0",
"test-listen": "^1.1.0",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
}
Expand Down
6 changes: 4 additions & 2 deletions test/wdio/wdio-globals.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { assert } from 'chai';
import express from 'express';
import { fixturesPath } from 'axe-test-fixtures';
import { Server, createServer } from 'http';
import testListen from 'test-listen';
import listen from 'async-listen';

describe('@wdio/globals', () => {
let server: Server;
Expand All @@ -14,7 +14,9 @@ describe('@wdio/globals', () => {
const app = express();
app.use(express.static(fixturesPath));
server = createServer(app);
addr = await testListen(server);
// async-listen adds trailing forward slash,
// this removes the unnecessary trailing forward slash
addr = (await listen(server)).toString().replace(/\/$/, '');
});

beforeEach(() => {
Expand Down

0 comments on commit 30af456

Please sign in to comment.