Skip to content

Commit

Permalink
chore: rebase (#15)
Browse files Browse the repository at this point in the history
* chore: rebase

* test: fix tests
  • Loading branch information
Wroud authored Sep 9, 2024
1 parent ba54318 commit 535793c
Show file tree
Hide file tree
Showing 57 changed files with 284 additions and 263 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 0 additions & 2 deletions packages/ci/src/gulp/prepublish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const changeLogFile = "CHANGELOG.md";
// print output of commands into the terminal
const stdio = "inherit";
const commitsConfig = { path: commitPath, ignore: /^chore: release/ };
const commitsConfig = { path: commitPath, ignore: /^chore: release/ };

async function bumpVersion(preset: Preset): Promise<string | null> {
const bumper = new RestrictEmptyCommits(process.cwd())
Expand All @@ -27,7 +26,6 @@ async function bumpVersion(preset: Preset): Promise<string | null> {
prefix: tagPrefix,
})
.commits(commitsConfig);
.commits(commitsConfig);

const recommendation = await bumper.bump();

Expand Down
3 changes: 1 addition & 2 deletions packages/di-react/src/useAbandonedRenderDisposer.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
// @vitest-environment happy-dom

import { describe, expect, it, vi } from "vitest";
import { afterEach, describe, expect, it, vi } from "vitest";
import { renderHook } from "@testing-library/react";
import "./tests/testingLibrary.js";
import { useAbandonedRenderDisposer } from "./useAbandonedRenderDisposer.js";
import { afterEach } from "node:test";

describe("useAbandonedRenderDisposer", () => {
afterEach(() => {
Expand Down
31 changes: 25 additions & 6 deletions packages/di-react/src/useServiceAsync.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
// @vitest-environment happy-dom

import { describe, expect, it, vi } from "vitest";
import {
afterAll,
afterEach,
beforeEach,
describe,
expect,
it,
vi,
type MockInstance,
} from "vitest";
import { renderHook, screen } from "@testing-library/react";
import "./tests/testingLibrary.js";
import { useServiceAsync } from "./useServiceAsync.js";
Expand All @@ -12,16 +21,28 @@ import {
} from "@wroud/di";
import { ServiceProvider } from "./ServiceProvider.js";
import { Suspense } from "react";
import { afterEach } from "node:test";

describe("useServiceAsync", () => {
let consoleWarn: MockInstance<
(message?: any, ...optionalParams: any[]) => void
>;

beforeEach(() => {
consoleWarn = vi.spyOn(console, "warn");
consoleWarn.mockImplementation(() => {});
});

afterEach(() => {
vi.restoreAllMocks();
vi.useRealTimers();
consoleWarn.mockReset();
});

afterAll(() => {
consoleWarn.mockReset();
});

it("should resolve single service", async () => {
const consoleWarn = vi.spyOn(console, "warn");
consoleWarn.mockImplementation(() => {});
const builder = new ServiceContainerBuilder();

@injectable()
Expand Down Expand Up @@ -62,8 +83,6 @@ describe("useServiceAsync", () => {
);
});
it("should resolve service with deps", async () => {
const consoleWarn = vi.spyOn(console, "warn");
consoleWarn.mockImplementation(() => {});
const builder = new ServiceContainerBuilder();

@injectable()
Expand Down
3 changes: 1 addition & 2 deletions packages/di-react/src/useServicesAsync.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @vitest-environment happy-dom

import { describe, expect, it, vi } from "vitest";
import { afterEach, describe, expect, it, vi } from "vitest";
import { renderHook, screen } from "@testing-library/react";
import "./tests/testingLibrary.js";
import { useServicesAsync } from "./useServicesAsync.js";
Expand All @@ -12,7 +12,6 @@ import {
} from "@wroud/di";
import { ServiceProvider } from "./ServiceProvider.js";
import { Suspense } from "react";
import { afterEach } from "node:test";

describe("useServicesAsync", () => {
afterEach(() => {
Expand Down
3 changes: 1 addition & 2 deletions packages/di/src/di/injectable.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { describe, expect, it, vi } from "vitest";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { injectable } from "./injectable.js";
import { ServiceRegistry } from "./ServiceRegistry.js";
import { beforeEach } from "node:test";

vi.mock(import("./ServiceRegistry.js"), () => ({
ServiceRegistry: {
Expand Down
Loading

0 comments on commit 535793c

Please sign in to comment.