mirror of
https://github.com/pezkuwichain/pezkuwi-dev.git
synced 2026-12-06 12:07:05 +00:00
- 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
61 lines
1.5 KiB
TypeScript
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');
|
|
});
|
|
});
|
|
}
|