Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate to esm #717

Merged
merged 1 commit into from
Nov 27, 2024
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
version: 9

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand All @@ -41,7 +41,7 @@ jobs:
run: pnpm install

- name: Run unit test
run: pnpm test:ci
run: pnpm test

e2e-tests:
name: end-to-end
Expand Down
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Mumble.proto
jest.config.ts
vitest.config.ts
renovate.json

# Logs
Expand Down
18 changes: 0 additions & 18 deletions e2e.jest.config.ts

This file was deleted.

2 changes: 1 addition & 1 deletion e2e/creates-and-removes-channels.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Channel, Client } from '@';
import { Channel, Client } from '../src';
import { readFile } from 'fs/promises';
import { join } from 'path';
import { waitABit } from './utils/wait-a-bit';
Expand Down
6 changes: 2 additions & 4 deletions e2e/handles-server-disconnects.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Client } from '@';
import { Client } from '../src';
import { waitABit } from './utils/wait-a-bit';

jest.setTimeout(60 * 1000);

describe('Handles server disconnects (e2e)', () => {
let client1: Client;
let client2: Client;
Expand Down Expand Up @@ -32,7 +30,7 @@ describe('Handles server disconnects (e2e)', () => {
client2.disconnect();
});

it('should handle error', async () => {
it('should handle error', { timeout: 60 * 1000 }, async () => {
let wasDisconnected = false;
client1.on('disconnect', () => (wasDisconnected = true));

Expand Down
2 changes: 1 addition & 1 deletion e2e/joins-channel.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client } from '@';
import { Client } from '../src';
import { waitABit } from './utils/wait-a-bit';

describe('Joins a channel (e2e)', () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/links-unlinks-channels.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client } from '@';
import { Client } from '../src';
import { readFile } from 'fs/promises';
import { join } from 'path';
import { waitABit } from './utils/wait-a-bit';
Expand Down
2 changes: 1 addition & 1 deletion e2e/list-channels.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client } from '@';
import { Client } from '../src';
import { waitABit } from './utils/wait-a-bit';

describe('List channels (e2e)', () => {
Expand Down
4 changes: 2 additions & 2 deletions e2e/logs-in-registered.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Client } from '@';
import { ConnectionRejectedError } from '@/errors';
import { Client } from '../src';
import { ConnectionRejectedError } from '../src/errors';
import { readFile } from 'fs/promises';
import { join } from 'path';
import { waitABit } from './utils/wait-a-bit';
Expand Down
2 changes: 2 additions & 0 deletions e2e/mumble-data/mumble_server_config.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Config file automatically generated from the MUMBLE_CONFIG_* environment variables
# or secrets in /run/secrets/MUMBLE_CONFIG_* files

autobanAttempts=0
database=/data/murmur.sqlite
ice="tcp -h 127.0.0.1 -p 6502"
welcometext="<br />Welcome to this server, running the official Mumble Docker image.<br />Enjoy your stay!<br />"
Expand Down
Binary file modified e2e/mumble-data/murmur.sqlite
Binary file not shown.
2 changes: 1 addition & 1 deletion e2e/rejects-creating-channel.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client } from '@';
import { Client } from '../src';
import { waitABit } from './utils/wait-a-bit';

describe('Rejects creating channel when there are insufficient permissions (e2e)', () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/rejects-joining-channel.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client } from '@';
import { Client } from '../src';
import { waitABit } from './utils/wait-a-bit';

describe('Rejects moving to a channel when there are insufficient permissions (e2e)', () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/rejects-removing-channel.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Client } from '@';
import { Client } from '../src';
import { waitABit } from './utils/wait-a-bit';

describe('Rejects removing channel when there are insufficient permissions (e2e)', () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/self-deafens.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { Client } from '@';
import { Client } from '../src';
import { waitABit } from './utils/wait-a-bit';

describe('Sets self-deaf (e2e)', () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/self-mutes.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { Client } from '@';
import { Client } from '../src';
import { waitABit } from './utils/wait-a-bit';

describe('Sets self-mute (e2e)', () => {
Expand Down
9 changes: 9 additions & 0 deletions e2e/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from 'vitest/config';

export default defineConfig({
test: {
globals: true,
include: ['**/*.e2e-spec.ts'],
fileParallelism: false,
},
});
18 changes: 0 additions & 18 deletions jest.config.ts

This file was deleted.

11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.7.3",
"description": "A simple bot for managing mumble servers",
"license": "MIT",
"type": "module",
"publishConfig": {
"access": "public"
},
Expand All @@ -19,9 +20,8 @@
"scripts": {
"lint": "eslint \"src/**/*.ts\"",
"build": "tsc --project tsconfig.build.json && tsc-alias -p tsconfig.build.json",
"test": "jest --watch",
"test:ci": "NODE_ENV=test jest --ci",
"test:e2e": "NODE_ENV=test jest --config e2e.jest.config.ts --runInBand",
"test": "vitest",
"test:e2e": "vitest --config ./e2e/vitest.config.ts",
"release": "release-it"
},
"contributors": [
Expand All @@ -39,21 +39,20 @@
"devDependencies": {
"@release-it/conventional-changelog": "9.0.3",
"@tsconfig/node16": "16.1.3",
"@types/jest": "29.5.14",
"@types/node": "22.10.0",
"@typescript-eslint/eslint-plugin": "8.16.0",
"@typescript-eslint/parser": "8.16.0",
"eslint": "9.15.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.2.1",
"jest": "29.7.0",
"prettier": "3.4.1",
"release-it": "17.10.0",
"trace-unhandled": "2.0.1",
"ts-jest": "29.2.5",
"ts-node": "10.9.2",
"tsc-alias": "1.8.10",
"tsconfig-paths": "4.2.0",
"typescript": "5.7.2"
"typescript": "5.7.2",
"vitest": "2.1.6"
}
}
Loading