Skip to content

Commit 8c52642

Browse files
committed
Fix tests/run-browser.mjs for new argument format
1 parent fe485c0 commit 8c52642

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/run-browser.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
2525
// THE POSSIBILITY OF SUCH DAMAGE.
2626

27-
import serve from "./server.mjs";
27+
import { serve, optionDefinitions as serverOptionDefinitions } from "./server.mjs";
2828
import { Builder, Capabilities, logging } from "selenium-webdriver";
2929
import { Options as ChromeOptions } from "selenium-webdriver/chrome.js";
3030
import { Options as FirefoxOptions } from "selenium-webdriver/firefox.js";
@@ -80,8 +80,8 @@ function sleep(ms) {
8080
}
8181

8282
const optionDefinitions = [
83+
...serverOptionDefinitions,
8384
{ name: "browser", type: String, description: "Set the browser to test, choices are [safari, firefox, chrome, edge]. By default the $BROWSER env variable is used." },
84-
{ name: "port", type: Number, defaultValue: 8010, description: "Set the test-server port, The default value is 8010." },
8585
{ name: "help", alias: "h", description: "Print this help text." },
8686
{ name: "suite", type: String, defaultOption: true, typeLabel: `{underline choices}: ${VALID_TAGS.join(", ")}`, description: "Run a specific suite by name." }
8787
];
@@ -142,7 +142,7 @@ process.once("uncaughtException", (err) => {
142142
});
143143

144144
const PORT = options.port;
145-
const server = await serve(PORT);
145+
const server = await serve(options);
146146

147147
async function runTests() {
148148
let success = true;

tests/server.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ import LocalWebServer from "local-web-server";
2929

3030
const ROOT_DIR = path.join(process.cwd(), "./");
3131

32-
const optionDefinitions = [
32+
export const optionDefinitions = [
3333
{ name: "port", type: Number, defaultValue: 8010, description: "Set the test-server port, The default value is 8010." },
3434
{ name: "verbose", type: Boolean, defaultValue: false, description: "Log all requests set to the server." },
3535
];
3636

37-
export default async function serve({ port, verbose }) {
37+
export async function serve({ port, verbose }) {
3838
if (!port)
3939
throw new Error("Port is required");
4040

0 commit comments

Comments
 (0)