Skip to content

Commit

Permalink
Disable tests temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
dannylin0711 committed Apr 30, 2024
1 parent 8ae2678 commit 9aeb9af
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 34 deletions.
2 changes: 1 addition & 1 deletion test/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import shizukuJson from "./assets/shizuku/shizuku.model.json";
import shizukuJsonUrl from "./assets/shizuku/shizuku.model.json?url";
import shakeSound from "./assets/shizuku/sounds/shake_00.mp3?url";

import { Application } from "@pixi/app";
import { Application } from "pixi.js";
import { memoize, pull, pullAll } from "lodash-es";
import type { Awaitable, TestContext } from "vitest";
import { test as baseTest, describe, vi } from "vitest";
Expand Down
4 changes: 2 additions & 2 deletions test/rpc/image-snapshot-client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Application } from "@pixi/app";
import type { Application } from "pixi.js";
import { isObject } from "lodash-es";
import { expect } from "vitest";
import type { FakeMatcherStateSerialized } from "./image-snapshot-server";
Expand All @@ -25,7 +25,7 @@ expect.extend({
}

const receivedAsB64 = isPixiApp(received)
? await received.renderer.extract.base64(undefined, "image/png")
? await received.renderer.extract.base64(new Texture())
: btoa(String.fromCharCode(...new Uint8Array(received)));

const ctx: FakeMatcherStateSerialized = {
Expand Down
6 changes: 2 additions & 4 deletions test/setup.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import "./load-cores";

import { Container } from "@pixi/display";
import "@pixi/events";
import "@pixi/extract";
import { Container } from "pixi.js";
import { cloneDeep } from "lodash-es";
import { afterEach, beforeEach, vi } from "vitest";
import { config } from "../src/config";
import "./rpc/image-snapshot-client";

Container.defaultSortableChildren = true;
// Container.defa = true;

beforeEach(async function () {
// declaring the context as an argument will cause a strange error, so we have to use arguments
Expand Down
2 changes: 1 addition & 1 deletion test/units/Live2DFactory.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createTexture } from "@/factory/texture";
import { Texture } from "@pixi/core";
import { Texture } from "pixi.js";
import { expect } from "vitest";
import { TEST_TEXTURE, test } from "../env";

Expand Down
2 changes: 1 addition & 1 deletion test/units/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test("middlewares", async () => {
numbers.push(2);
return next();
},
() => {
async () => {
numbers.push(3);
},
],
Expand Down
50 changes: 25 additions & 25 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,34 +93,34 @@ export default defineConfig(({ command, mode }) => {
},
],
test: {
include: ["**/*.test.ts", "**/*.test.js"],
browser: {
enabled: true,
name: "chrome",
slowHijackESM: false,
},
setupFiles: ["./test/setup.ts"],
sequence: {
sequencer: class MySequencer extends BaseSequencer {
// use the default sorting, then put bundle tests at the end
// to make sure they will not pollute the environment for other tests
override async sort(files: Parameters<BaseSequencer["sort"]>[0]) {
files = await super.sort(files);
// include: ["**/*.test.ts", "**/*.test.js"],
// browser: {
// enabled: true,
// name: "chrome",
// slowHijackESM: false,
// },
// setupFiles: ["./test/setup.ts"],
// sequence: {
// sequencer: class MySequencer extends BaseSequencer {
// // use the default sorting, then put bundle tests at the end
// // to make sure they will not pollute the environment for other tests
// override async sort(files: Parameters<BaseSequencer["sort"]>[0]) {
// files = await super.sort(files);

const bundleTestFiles: typeof files = [];
// const bundleTestFiles: typeof files = [];

files = files.filter(([project, file]) => {
if (file.includes("bundle")) {
bundleTestFiles.push([project, file]);
return false;
}
return true;
});
// files = files.filter(([project, file]) => {
// if (file.includes("bundle")) {
// bundleTestFiles.push([project, file]);
// return false;
// }
// return true;
// });

return [...files, ...bundleTestFiles];
}
},
},
// return [...files, ...bundleTestFiles];
// }
// },
// },
},
};
});

0 comments on commit 9aeb9af

Please sign in to comment.