Skip to content

feat(Core): create initial core package#2

Draft
ElijahKotyluk wants to merge 13 commits intomasterfrom
feat/core
Draft

feat(Core): create initial core package#2
ElijahKotyluk wants to merge 13 commits intomasterfrom
feat/core

Conversation

@ElijahKotyluk
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings November 16, 2025 05:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR establishes the initial core package by introducing a test framework implementation with classes and interfaces for managing test execution, results, and status tracking.

Key Changes:

  • Introduces a Test class for executing and tracking individual test cases
  • Defines TaskStatus enum and related interfaces (TestTask, TestResult) for test lifecycle management
  • Exports core testing types and classes for use across the package

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 27, 2025 01:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 4 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 27, 2025 02:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 21 changed files in this pull request and generated 8 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 27, 2025 06:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 24 changed files in this pull request and generated 4 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 27, 2025 08:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 26 out of 28 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 27, 2025 08:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 26 out of 28 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


"compilerOptions": {
"outDir": "./dist"
"outDir": "./dist",
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Trailing comma after the last property in the compilerOptions object is inconsistent with JSON best practices and may cause issues with strict JSON parsers.

Suggested change
"outDir": "./dist",
"outDir": "./dist"

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings November 27, 2025 08:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 26 out of 28 changed files in this pull request and generated 5 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

description: `${this.getFullDescription()} > ${test.description}`,
status: test.status,
error: test.error,
durationMs: test.durationMs ?? 0,
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test.durationMs field is initialized to 0 in the Test class constructor, so it will never be undefined. The nullish coalescing operator (?? 0) is unnecessary and suggests a mismatch between the implementation and usage.

Suggested change
durationMs: test.durationMs ?? 0,
durationMs: test.durationMs,

Copilot uses AI. Check for mistakes.
Comment on lines 143 to 147
// Order of keys matter
for (let i = 0; i < xKeys.length; i++) {
if (xKeys[i] !== yKeys[i]) return false;
}

Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment states 'Order of keys matter', but Object.keys() does not guarantee a stable ordering across all JavaScript engines for all object types. This assumption may lead to false negatives when comparing objects with identical properties in different enumeration orders. Consider documenting this limitation or revising the logic to compare keys as sets.

Suggested change
// Order of keys matter
for (let i = 0; i < xKeys.length; i++) {
if (xKeys[i] !== yKeys[i]) return false;
}
// Compare keys as sets (order does not matter)
for (const key of xKeys) {
if (!yKeys.includes(key)) return false;
}
for (const key of yKeys) {
if (!xKeys.includes(key)) return false;
}

Copilot uses AI. Check for mistakes.
},

toEqual<T>(this: MatcherContext, received: T, expected: T) {
const pass = JSON.stringify(received) === JSON.stringify(expected);
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSON.stringify does not handle undefined values, functions, symbols, Maps, Sets, or circular references correctly. This will produce incorrect equality results for these types. Consider using deepEqual here or documenting that toEqual only supports JSON-serializable values.

Suggested change
const pass = JSON.stringify(received) === JSON.stringify(expected);
const pass = deepEqual(received, expected);

Copilot uses AI. Check for mistakes.
Comment on lines +19 to +22
describe("Failing Test Suite", () => {
it("should fail this test", () => {
expect(1 + 1).toBe(3);
});
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test suite intentionally includes a failing test, which will cause the test run to fail. If this is intended for testing framework behavior, consider isolating it or adding documentation explaining its purpose. Otherwise, fix the assertion to expect(1 + 1).toBe(2).

Copilot uses AI. Check for mistakes.
},
"exclude": [
"ts-node": {
// Tell ts-node CLI to install the --loader automatically, explained below
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment references 'explained below' but no further explanation is provided. Either add the promised explanation or remove this comment to avoid confusion.

Suggested change
// Tell ts-node CLI to install the --loader automatically, explained below

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings November 27, 2025 09:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 26 out of 28 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 27, 2025 10:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 26 out of 28 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +25 to +33
const describe = (description: string, fn: PromisableFn<void>) => {
return _describe(description, fn);
};

const it = (description: string, fn: PromisableFn<void>) => {
return _it(description, fn);
};

export { describe, it };
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] These wrapper functions are unnecessary - they simply forward to the internal functions without adding any value. Consider exporting _describe and _it directly as describe and it.

Suggested change
const describe = (description: string, fn: PromisableFn<void>) => {
return _describe(description, fn);
};
const it = (description: string, fn: PromisableFn<void>) => {
return _it(description, fn);
};
export { describe, it };
export { _describe as describe, _it as it };

Copilot uses AI. Check for mistakes.
$chore(core): remove comments, update pkg version.
Copilot AI review requested due to automatic review settings November 27, 2025 16:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 26 out of 28 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{
"name": "@onyxjs/core",
"version": "1.0.0",
"name": "@onyx.js/core",
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Package name inconsistency: the package is named '@onyx.js/core' but the import in onyx.config.ts uses '@onyxjs/core'. Consider using a consistent naming convention, either '@onyx.js/core' or '@onyxjs/core' throughout.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,9 @@
import { defineConfig } from "@onyxjs/core";
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import path '@onyxjs/core' doesn't match the package name '@onyx.js/core' defined in package.json. Update to use '@onyx.js/core' for consistency.

Suggested change
import { defineConfig } from "@onyxjs/core";
import { defineConfig } from "@onyx.js/core";

Copilot uses AI. Check for mistakes.

import type { PromisableFn } from "./types";

function _describe(description: string, fn: PromisableFn<void>) {
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fn parameter is typed as PromisableFn (which can return a Promise), but it's called synchronously on line 14 without await. This could cause issues if fn returns a Promise. Either change the type to exclude Promise or handle async execution properly.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants