Skip to content
Open

Esm #480

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"license": "MIT",
"main": "index.js",
"type": "module",
"scripts": {
"build": "tsc -p tsconfig.server.json",
"chrome": "vitest ./tests",
Expand All @@ -14,8 +15,8 @@
"dev": "vitest ./tests --browser.headless",
"firefox": "vitest run ./tests --browser.headless --config vitest.firefox.config.mts",
"format": "biome check --write server tests",
"server": "ts-node-dev --project tsconfig.server.json ./server/main.ts",
"server:dev": "DEBUG=werift* ts-node-dev --project tsconfig.server.json ./server/main.ts",
"server": "tsx --tsconfig tsconfig.server.json ./server/main.ts",
"server:dev": "DEBUG=werift* tsx --tsconfig tsconfig.server.json ./server/main.ts",
"server:prod": "DEBUG=werift* node lib/e2e/server/main.js",
"server:silent": "node lib/e2e/server/main.js",
"type": "tsc --noEmit -p tsconfig.server.json && tsc --noEmit -p tsconfig.json",
Expand Down
10 changes: 5 additions & 5 deletions e2e/server/fixture.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {
type BundlePolicy,
NamedCurveAlgorithm,
} from "../../packages/webrtc/src/index.js";
import {
type DtlsKeys,
HashAlgorithm,
type PeerConfig,
SignatureAlgorithm,
createSelfSignedCertificate,
} from ".";
import {
type BundlePolicy,
NamedCurveAlgorithm,
} from "../../packages/webrtc/src";
} from "./index.js";

export class DtlsKeysContext {
private static rsa: DtlsKeys;
Expand Down
4 changes: 2 additions & 2 deletions e2e/server/handler/bundle/disable.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AcceptFn, Peer } from "protoo-server";
import { RTCPeerConnection } from "../..";
import { peerConfig } from "../../fixture";
import { peerConfig } from "../../fixture.js";
import { RTCPeerConnection } from "../../index.js";

export class bundle_disable_answer {
pc!: RTCPeerConnection;
Expand Down
4 changes: 2 additions & 2 deletions e2e/server/handler/bundle/max-bundle.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AcceptFn, Peer } from "protoo-server";
import { RTCPeerConnection } from "../..";
import { peerConfig } from "../../fixture";
import { peerConfig } from "../../fixture.js";
import { RTCPeerConnection } from "../../index.js";

export class bundle_max_bundle_answer {
pc!: RTCPeerConnection;
Expand Down
4 changes: 2 additions & 2 deletions e2e/server/handler/bundle/max-compat.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AcceptFn } from "protoo-server";
import { RTCPeerConnection } from "../..";
import { peerConfig } from "../../fixture";
import { peerConfig } from "../../fixture.js";
import { RTCPeerConnection } from "../../index.js";

export class bundle_max_compat_answer {
pc!: RTCPeerConnection;
Expand Down
4 changes: 2 additions & 2 deletions e2e/server/handler/combination/allmedia.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AcceptFn } from "protoo-server";
import { RTCPeerConnection } from "../..";
import { peerConfig } from "../../fixture";
import { peerConfig } from "../../fixture.js";
import { RTCPeerConnection } from "../../index.js";

export class combination_all_media_answer {
pc!: RTCPeerConnection;
Expand Down
4 changes: 2 additions & 2 deletions e2e/server/handler/datachannel/close.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AcceptFn } from "protoo-server";
import { type RTCDataChannel, RTCPeerConnection } from "../../";
import { peerConfig } from "../../fixture";
import { peerConfig } from "../../fixture.js";
import { type RTCDataChannel, RTCPeerConnection } from "../../index.js";

export class datachannel_close_server_create_close {
pc!: RTCPeerConnection;
Expand Down
4 changes: 2 additions & 2 deletions e2e/server/handler/datachannel/datachannel.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AcceptFn } from "protoo-server";
import { RTCPeerConnection } from "../..";
import { peerConfig } from "../../fixture";
import { peerConfig } from "../../fixture.js";
import { RTCPeerConnection } from "../../index.js";

export class datachannel_answer {
pc!: RTCPeerConnection;
Expand Down
4 changes: 2 additions & 2 deletions e2e/server/handler/ice/restart.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AcceptFn, Peer } from "protoo-server";
import { RTCPeerConnection } from "../..";
import { peerConfig } from "../../fixture";
import { peerConfig } from "../../fixture.js";
import { RTCPeerConnection } from "../../index.js";

const ice_restart_web_trigger_label = "ice_restart_web_trigger";
export class ice_restart_web_trigger {
Expand Down
4 changes: 2 additions & 2 deletions e2e/server/handler/ice/trickle.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AcceptFn, Peer } from "protoo-server";
import { RTCPeerConnection } from "../..";
import { peerConfig } from "../../fixture";
import { peerConfig } from "../../fixture.js";
import { RTCPeerConnection } from "../../index.js";

export class ice_trickle_answer {
pc!: RTCPeerConnection;
Expand Down
4 changes: 2 additions & 2 deletions e2e/server/handler/mediachannel/addTrack.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { type ChildProcess, spawn } from "child_process";
import { createSocket } from "dgram";
import type { AcceptFn } from "protoo-server";
import { peerConfig } from "../../fixture.js";
import {
MediaStreamTrack,
MediaStreamTrackFactory,
RTCPeerConnection,
RtpPacket,
randomPort,
} from "../../";
import { peerConfig } from "../../fixture";
} from "../../index.js";

export class mediachannel_addTrack_answer {
pc!: RTCPeerConnection;
Expand Down
4 changes: 2 additions & 2 deletions e2e/server/handler/mediachannel/oneway.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AcceptFn } from "protoo-server";
import { RTCPeerConnection } from "../..";
import { peerConfig } from "../../fixture";
import { peerConfig } from "../../fixture.js";
import { RTCPeerConnection } from "../../index.js";

export class mediachannel_oneway_answer {
pc!: RTCPeerConnection;
Expand Down
4 changes: 2 additions & 2 deletions e2e/server/handler/mediachannel/red.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { type ChildProcess, spawn } from "child_process";
import { createSocket } from "dgram";
import type { AcceptFn } from "protoo-server";
import { DtlsKeysContext } from "../../fixture.js";
import {
MediaStreamTrack,
RTCPeerConnection,
RTCRtpCodecParameters,
randomPort,
} from "../../";
import { DtlsKeysContext } from "../../fixture";
} from "../../index.js";

export class mediachannel_red_client_answer {
pc!: RTCPeerConnection;
Expand Down
4 changes: 2 additions & 2 deletions e2e/server/handler/mediachannel/removeTrack.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { type ChildProcess, spawn } from "child_process";
import { createSocket } from "dgram";
import type { AcceptFn } from "protoo-server";
import { peerConfig } from "../../fixture.js";
import {
MediaStreamTrack,
RTCPeerConnection,
RtpPacket,
randomPort,
} from "../../";
import { peerConfig } from "../../fixture";
} from "../../index.js";

export class mediachannel_removetrack_answer_base {
pc!: RTCPeerConnection;
Expand Down
4 changes: 2 additions & 2 deletions e2e/server/handler/mediachannel/rtx.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { type ChildProcess, spawn } from "child_process";
import { createSocket } from "dgram";
import type { AcceptFn } from "protoo-server";
import { DtlsKeysContext } from "../../fixture.js";
import {
MediaStreamTrack,
RTCPeerConnection,
RTCRtpCodecParameters,
RtpPacket,
randomPort,
} from "../../";
import { DtlsKeysContext } from "../../fixture";
} from "../../index.js";

export class mediachannel_rtx_client_answer {
pc!: RTCPeerConnection;
Expand Down
4 changes: 2 additions & 2 deletions e2e/server/handler/mediachannel/sendrecv.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AcceptFn } from "protoo-server";
import { RTCPeerConnection } from "../../";
import { peerConfig } from "../../fixture";
import { peerConfig } from "../../fixture.js";
import { RTCPeerConnection } from "../../index.js";

export class mediachannel_sendrecv_answer {
pc!: RTCPeerConnection;
Expand Down
4 changes: 2 additions & 2 deletions e2e/server/handler/mediachannel/simulcast.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AcceptFn } from "protoo-server";
import { RTCPeerConnection, useSdesRTPStreamId } from "../../";
import { DtlsKeysContext } from "../../fixture";
import { DtlsKeysContext } from "../../fixture.js";
import { RTCPeerConnection, useSdesRTPStreamId } from "../../index.js";

export class mediachannel_simulcast_answer {
pc!: RTCPeerConnection;
Expand Down
2 changes: 1 addition & 1 deletion e2e/server/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "../../packages/webrtc/src";
export * from "../../packages/webrtc/src/index.js";
// export * from "werift";
33 changes: 18 additions & 15 deletions e2e/server/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,63 +4,66 @@ import { Room, WebSocketServer } from "protoo-server";
import {
bundle_disable_answer,
bundle_disable_offer,
} from "./handler/bundle/disable";
} from "./handler/bundle/disable.js";
import {
bundle_max_bundle_answer,
bundle_max_bundle_offer,
} from "./handler/bundle/max-bundle";
} from "./handler/bundle/max-bundle.js";
import {
bundle_max_compat_answer,
bundle_max_compat_offer,
} from "./handler/bundle/max-compat";
} from "./handler/bundle/max-compat.js";
import {
combination_all_media_answer,
combination_all_media_offer,
} from "./handler/combination/allmedia";
} from "./handler/combination/allmedia.js";
import {
datachannel_close_client_create_close,
datachannel_close_client_create_server_close,
datachannel_close_server_create_client_close,
datachannel_close_server_create_close,
} from "./handler/datachannel/close";
} from "./handler/datachannel/close.js";
import {
datachannel_answer,
datachannel_offer,
} from "./handler/datachannel/datachannel";
} from "./handler/datachannel/datachannel.js";
import {
ice_restart_node_trigger,
ice_restart_web_trigger,
} from "./handler/ice/restart";
import { ice_trickle_answer, ice_trickle_offer } from "./handler/ice/trickle";
} from "./handler/ice/restart.js";
import {
ice_trickle_answer,
ice_trickle_offer,
} from "./handler/ice/trickle.js";
import {
mediachannel_addTrack_answer,
mediachannel_addTrack_offer,
} from "./handler/mediachannel/addTrack";
} from "./handler/mediachannel/addTrack.js";
import {
mediachannel_oneway_answer,
mediachannel_oneway_offer,
} from "./handler/mediachannel/oneway";
} from "./handler/mediachannel/oneway.js";
import {
mediachannel_red_client_answer,
mediachannel_red_client_offer,
} from "./handler/mediachannel/red";
} from "./handler/mediachannel/red.js";
import {
mediachannel_addtrack_removefirst_addtrack,
mediachannel_offer_replace_second,
mediachannel_removetrack_addtrack,
} from "./handler/mediachannel/removeTrack";
} from "./handler/mediachannel/removeTrack.js";
import {
mediachannel_rtx_client_answer,
mediachannel_rtx_client_offer,
} from "./handler/mediachannel/rtx";
} from "./handler/mediachannel/rtx.js";
import {
mediachannel_sendrecv_answer,
mediachannel_sendrecv_offer,
} from "./handler/mediachannel/sendrecv";
} from "./handler/mediachannel/sendrecv.js";
import {
mediachannel_simulcast_answer,
mediachannel_simulcast_offer,
} from "./handler/mediachannel/simulcast";
} from "./handler/mediachannel/simulcast.js";

const app = express();
app.use(express.json() as never);
Expand Down
2 changes: 1 addition & 1 deletion e2e/stop.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
const axios = require("axios");
import axios from "axios";
axios.put("http://localhost:8886/stop");
2 changes: 1 addition & 1 deletion e2e/tests/bundle/disable.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Counter, peer, sleep, waitVideoPlay } from "../fixture";
import { Counter, peer, sleep, waitVideoPlay } from "../fixture.js";

describe("bundle_disable", () => {
it(
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/bundle/max-bundle.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Counter, peer, sleep, waitVideoPlay } from "../fixture";
import { Counter, peer, sleep, waitVideoPlay } from "../fixture.js";

describe("bundle_max_bundle", () => {
it(
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/bundle/max-compat.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Counter, peer, sleep, waitVideoPlay } from "../fixture";
import { Counter, peer, sleep, waitVideoPlay } from "../fixture.js";

describe("bundle_max_compat", () => {
it(
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/combination/allmedia.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Counter, peer, sleep, waitVideoPlay } from "../fixture";
import { Counter, peer, sleep, waitVideoPlay } from "../fixture.js";

describe("combination_all_media", () => {
it("combination_all_media_answer", async () =>
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/datachannel/close.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { peer, sleep } from "../fixture";
import { peer, sleep } from "../fixture.js";

describe("datachannel/close", () => {
it("datachannel_close_server_create_close", async () =>
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/datachannel/datachannel.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { peer, sleep } from "../fixture";
import { peer, sleep } from "../fixture.js";

describe("datachannel", () => {
it("answer", async () =>
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/ice/restart.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { peer, sleep, waitVideoPlay } from "../fixture";
import { peer, sleep, waitVideoPlay } from "../fixture.js";

const ice_restart_web_trigger_label = "ice_restart_web_trigger";
const ice_restart_node_trigger_label = "ice_restart_node_trigger";
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/ice/trickle.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { peer, sleep, waitVideoPlay } from "../fixture";
import { peer, sleep, waitVideoPlay } from "../fixture.js";

describe("ice/trickle", () => {
it("answer", async () =>
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/mediachannel/addTrack.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { peer, sleep, waitVideoPlay } from "../fixture";
import { peer, sleep, waitVideoPlay } from "../fixture.js";

describe("mediachannel_addTrack", () => {
it("mediachannel_addTrack_answer", async () =>
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/mediachannel/oneway.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { peer, sleep, waitVideoPlay } from "../fixture";
import { peer, sleep, waitVideoPlay } from "../fixture.js";

describe("mediachannel_oneway", () => {
it("answer", async () =>
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/mediachannel/red.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import "buffer";
import { Red } from "werift-rtp";
import { Counter, browserName, peer, sleep } from "../fixture";
import { Counter, browserName, peer, sleep } from "../fixture.js";

describe("mediachannel_red", () => {
if (browserName === "Firefox") {
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/mediachannel/removeTrack.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { browserName, peer, sleep, waitVideoPlay } from "../fixture";
import { browserName, peer, sleep, waitVideoPlay } from "../fixture.js";

const mediachannel_removetrack_addtrack = "mediachannel_removetrack_addtrack";
const mediachannel_addtrack_removefirst_addtrack =
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/mediachannel/rtx.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { peer, sleep, waitVideoPlay } from "../fixture";
import { peer, sleep, waitVideoPlay } from "../fixture.js";

describe("mediachannel_rtx", () => {
it("mediachannel_rtx_client_answer", async () =>
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/mediachannel/sendrecv.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { peer, sleep, waitVideoPlay } from "../fixture";
import { peer, sleep, waitVideoPlay } from "../fixture.js";

describe("mediachannel_sendrecv", () => {
it("mediachannel_sendrecv_answer", async () =>
Expand Down
2 changes: 1 addition & 1 deletion e2e/tests/mediachannel/simulcast.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { peer, sleep, waitVideoPlay } from "../fixture";
import { peer, sleep, waitVideoPlay } from "../fixture.js";

describe("mediachannel_simulcast", () => {
it("mediachannel_simulcast_answer", async () =>
Expand Down
Loading