Skip to content

Commit

Permalink
updated rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
osztenkurden committed May 14, 2024
1 parent b23b3f0 commit 138bb6a
Show file tree
Hide file tree
Showing 41 changed files with 4,680 additions and 3,401 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

30 changes: 15 additions & 15 deletions __tests__/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
CSGOGSI,
import type {
CSGORaw,
DecoySmokeGrenade,
Events,
Expand All @@ -10,7 +9,8 @@ import {
PlayerRaw,
TeamExtension
} from '../tsc';
import { Callback } from '../tsc/events';
import { CSGOGSI } from '../tsc';
import type { Callback } from '../tsc/events';
import { createGSIPacket, createHurtPacket, createKillPacket } from './data';
import { testCases } from './data/bombSites';

Expand Down Expand Up @@ -331,9 +331,9 @@ test('data > rounds: proper parser in 1st half', () => {
expect(data).not.toBeNull();

expect(data?.map.rounds.length).toBe(3);
expect(data?.map.rounds[0].round).toBe(1);
expect(data?.map.rounds[1].side).toBe('CT');
expect(data?.map.rounds[2].team.side).toBe('T');
expect(data?.map.rounds[0]?.round).toBe(1);
expect(data?.map.rounds[1]?.side).toBe('CT');
expect(data?.map.rounds[2]?.team.side).toBe('T');
});

test('data > rounds: proper parser in 2nd half', () => {
Expand Down Expand Up @@ -378,12 +378,12 @@ test('data > rounds: proper parser in 2nd half', () => {
expect(data).not.toBeNull();

expect(data?.map.rounds.length).toBe(23);
expect(data?.map.rounds[0].side).not.toBe(data?.map.rounds[0].team.side);
expect(data?.map.rounds[5].side).not.toBe(data?.map.rounds[5].team.side);
expect(data?.map.rounds[10].side).not.toBe(data?.map.rounds[10].team.side);
expect(data?.map.rounds[18].side).toBe(data?.map.rounds[18].team.side);
expect(data?.map.rounds[20].side).toBe(data?.map.rounds[20].team.side);
expect(data?.map.rounds[21].side).toBe(data?.map.rounds[21].team.side);
expect(data?.map.rounds[0]?.side).not.toBe(data?.map.rounds[0]?.team.side);
expect(data?.map.rounds[5]?.side).not.toBe(data?.map.rounds[5]?.team.side);
expect(data?.map.rounds[10]?.side).not.toBe(data?.map.rounds[10]?.team.side);
expect(data?.map.rounds[18]?.side).toBe(data?.map.rounds[18]?.team.side);
expect(data?.map.rounds[20]?.side).toBe(data?.map.rounds[20]?.team.side);
expect(data?.map.rounds[21]?.side).toBe(data?.map.rounds[21]?.team.side);
});

test('data > rounds: parser doesnt throw on wrong round wins list', () => {
Expand Down Expand Up @@ -430,9 +430,9 @@ test('data > rounds: parser correctly gets just ended round', () => {
);

expect(data?.map.rounds.length).toBe(4);
expect(data?.map.rounds[3].side).toBe('T');
expect(data?.map.rounds[3].round).toBe(4);
expect(data?.map.rounds[3].outcome).toBe('t_win_elimination');
expect(data?.map.rounds[3]?.side).toBe('T');
expect(data?.map.rounds[3]?.round).toBe(4);
expect(data?.map.rounds[3]?.outcome).toBe('t_win_elimination');
});

test('data > player: dont assign observer if cant find', () => {
Expand Down
25 changes: 25 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const eslint = require('@eslint/js');
const tseslint = require('typescript-eslint');

module.exports = tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
files: ["tsc/*.ts"],
rules:{
"no-console": 1,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/ban-types": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-empty-function":0,
"no-empty": 0,
"@typescript-eslint/no-var-requires":0,
"no-mixed-spaces-and-tabs": ["warn", "smart-tabs"],
"@typescript-eslint/explicit-function-return-type":0,
"@typescript-eslint/camelcase":0
},
},
{
ignores: ["types/*", "lib/*", "__tests__", "eslint.config.js"]
}
);
6 changes: 6 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
modulePathIgnorePatterns: ['<rootDir>/__tests__/data/'],
};
5 changes: 3 additions & 2 deletions jest.config.ts → jest.confisg.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
export default {
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
modulePathIgnorePatterns: ['<rootDir>/__tests__/data/'],
coverageReporters: ['json-summary', 'text', 'lcov'],
resolver: 'jest-ts-webcompat-resolver'
resolver: 'jest-ts-webcompat-resolver',
useESM: true
};
185 changes: 0 additions & 185 deletions lib/cjs/csgo.d.ts

This file was deleted.

38 changes: 0 additions & 38 deletions lib/cjs/events.d.ts

This file was deleted.

Loading

0 comments on commit 138bb6a

Please sign in to comment.