Skip to content

Commit 535793c

Browse files
authored
chore: rebase (#15)
* chore: rebase * test: fix tests
1 parent ba54318 commit 535793c

File tree

57 files changed

+284
-263
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+284
-263
lines changed
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.

packages/ci/src/gulp/prepublish.ts

-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const changeLogFile = "CHANGELOG.md";
1818
// print output of commands into the terminal
1919
const stdio = "inherit";
2020
const commitsConfig = { path: commitPath, ignore: /^chore: release/ };
21-
const commitsConfig = { path: commitPath, ignore: /^chore: release/ };
2221

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

3230
const recommendation = await bumper.bump();
3331

packages/di-react/src/useAbandonedRenderDisposer.test.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
// @vitest-environment happy-dom
22

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

98
describe("useAbandonedRenderDisposer", () => {
109
afterEach(() => {

packages/di-react/src/useServiceAsync.test.tsx

+25-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
// @vitest-environment happy-dom
22

3-
import { describe, expect, it, vi } from "vitest";
3+
import {
4+
afterAll,
5+
afterEach,
6+
beforeEach,
7+
describe,
8+
expect,
9+
it,
10+
vi,
11+
type MockInstance,
12+
} from "vitest";
413
import { renderHook, screen } from "@testing-library/react";
514
import "./tests/testingLibrary.js";
615
import { useServiceAsync } from "./useServiceAsync.js";
@@ -12,16 +21,28 @@ import {
1221
} from "@wroud/di";
1322
import { ServiceProvider } from "./ServiceProvider.js";
1423
import { Suspense } from "react";
15-
import { afterEach } from "node:test";
1624

1725
describe("useServiceAsync", () => {
26+
let consoleWarn: MockInstance<
27+
(message?: any, ...optionalParams: any[]) => void
28+
>;
29+
30+
beforeEach(() => {
31+
consoleWarn = vi.spyOn(console, "warn");
32+
consoleWarn.mockImplementation(() => {});
33+
});
34+
1835
afterEach(() => {
1936
vi.restoreAllMocks();
2037
vi.useRealTimers();
38+
consoleWarn.mockReset();
2139
});
40+
41+
afterAll(() => {
42+
consoleWarn.mockReset();
43+
});
44+
2245
it("should resolve single service", async () => {
23-
const consoleWarn = vi.spyOn(console, "warn");
24-
consoleWarn.mockImplementation(() => {});
2546
const builder = new ServiceContainerBuilder();
2647

2748
@injectable()
@@ -62,8 +83,6 @@ describe("useServiceAsync", () => {
6283
);
6384
});
6485
it("should resolve service with deps", async () => {
65-
const consoleWarn = vi.spyOn(console, "warn");
66-
consoleWarn.mockImplementation(() => {});
6786
const builder = new ServiceContainerBuilder();
6887

6988
@injectable()

packages/di-react/src/useServicesAsync.test.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @vitest-environment happy-dom
22

3-
import { describe, expect, it, vi } from "vitest";
3+
import { afterEach, describe, expect, it, vi } from "vitest";
44
import { renderHook, screen } from "@testing-library/react";
55
import "./tests/testingLibrary.js";
66
import { useServicesAsync } from "./useServicesAsync.js";
@@ -12,7 +12,6 @@ import {
1212
} from "@wroud/di";
1313
import { ServiceProvider } from "./ServiceProvider.js";
1414
import { Suspense } from "react";
15-
import { afterEach } from "node:test";
1615

1716
describe("useServicesAsync", () => {
1817
afterEach(() => {

packages/di/src/di/injectable.test.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { describe, expect, it, vi } from "vitest";
1+
import { beforeEach, describe, expect, it, vi } from "vitest";
22
import { injectable } from "./injectable.js";
33
import { ServiceRegistry } from "./ServiceRegistry.js";
4-
import { beforeEach } from "node:test";
54

65
vi.mock(import("./ServiceRegistry.js"), () => ({
76
ServiceRegistry: {

0 commit comments

Comments
 (0)