Files
pezkuwi-dev/packages/dev/src/rootTests.ts
Kurdistan Tech Ministry cb6801a3cc Fix lint errors: Update copyright years to 2026 and ignore build outputs
- Updated all copyright headers from 2025 to 2026 (system date shows 2026)
- Added build output files to eslint ignore list in packages/dev/config/eslint.js
- Added build output patterns to .gitignore
- Ignored: packages/*/*.{d.ts,js,mjs,cjs}, packages/*/cjs/**, packages/*/env/**,
  packages/*/rootJs/**, packages/*/rootStatic/**
- Successfully resolved 521 lint errors by properly ignoring generated files
- Build outputs should not be linted (source files are linted instead)
- Lint and build now pass successfully
2026-01-17 21:02:45 +03:00

61 lines
1.5 KiB
TypeScript

// Copyright 2017-2026 @pezkuwi/dev authors & contributors
// SPDX-License-Identifier: Apache-2.0
/// <reference types="@pezkuwi/dev-test/globals.d.ts" />
/* global describe, expect, it */
import type * as testRoot from './root.js';
export function runTests ({ Clazz, TEST_PURE, bigIntExp, dynamic, jsOpExp, json }: typeof testRoot): void {
describe('Clazz', (): void => {
it('has staticProperty', (): void => {
expect(Clazz.staticProperty).toBe('foobar');
});
it('creates an instance with get/set', (): void => {
const c = new Clazz(456);
expect(c.something).toBe(123_456_789 & 456);
c.setSomething(123);
expect(c.something).toBe(123 & 456);
});
});
describe('TEST_PURE', (): void => {
it('should have the correct value', (): void => {
expect(TEST_PURE).toBe('testRoot');
});
});
describe('dynamic()', (): void => {
it('should allow dynamic import usage', async (): Promise<void> => {
expect(await dynamic(5, 37)).toBe(42);
});
});
describe('bigIntExp()', (): void => {
it('should return the correct value', (): void => {
expect(bigIntExp()).toBe(123_456_789n * 137_858_491_849n);
});
});
describe('jsOpExp', (): void => {
it('handles 0 ?? 42 correctly', (): void => {
expect(jsOpExp(0)).toBe(0);
});
it('handles undefined ?? 42 correctly', (): void => {
expect(jsOpExp()).toBe(42);
});
});
describe('json()', (): void => {
it('should return the correct value', (): void => {
expect(json()).toBe('works');
});
});
}