Skip to content

Commit

Permalink
Remove linter
Browse files Browse the repository at this point in the history
  • Loading branch information
bb-face committed Jul 24, 2024
1 parent f10db80 commit 787040a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion lib/dev.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { FSWatcher } from "chokidar";
import path from "path";
import { Server as IoServer } from "socket.io";
import { buildApp } from "@/lib/build";
Expand All @@ -8,7 +9,6 @@ import { Network } from "@/lib/types";
import { loopThroughFiles, readFile, readJson, writeJson } from "@/lib/utils/fs";
import { mergeDeep, substractDeep } from "@/lib/utils/objects";
import { startFileWatcher } from "@/lib/watcher";
import { FSWatcher } from "chokidar";

var appSrcs = [], appDists = [];
var appDevJsons = [];
Expand Down
27 changes: 12 additions & 15 deletions tests/unit/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,13 @@ describe("dev", () => {
it("should call startFileWatcher with correct watch paths", async () => {
await dev(mockSrc, "build", mockOpts);
const expectedWatchPaths = [
path.join(mockSrc, "widget", "**", "*"),
path.join(mockSrc, "module", "**", "*"),
path.join(mockSrc, "ipfs", "**", "*"),
path.join(mockSrc, "bos.config.json"),
path.join(mockSrc, "aliases.json"),
path.join(mockSrc, 'widget', '**', '*'),
path.join(mockSrc, 'module', '**', '*'),
path.join(mockSrc, 'ipfs', '**', '*'),
path.join(mockSrc, 'bos.config.json'),
path.join(mockSrc, 'aliases.json'),
];
expect(startFileWatcher).toHaveBeenCalledWith(
expectedWatchPaths,
expect.any(Function)
);
expect(startFileWatcher).toHaveBeenCalledWith(expectedWatchPaths, expect.any(Function));
});

it("should add correct watch paths after adding apps", async () => {
Expand All @@ -106,15 +103,15 @@ describe("dev", () => {

const mockSrc2 = "/app_example_2";
vol.fromJSON(app_example_2, mockSrc2);
const mockDist2 = path.join(mockSrc2, "build");
const mockDist2 = path.join(mockSrc2, 'build');
await addApps([mockSrc2], [mockDist2]);

const expectedWatchPaths = [
path.join(mockSrc2, "widget", "**", "*"),
path.join(mockSrc2, "module", "**", "*"),
path.join(mockSrc2, "ipfs", "**", "*"),
path.join(mockSrc2, "bos.config.json"),
path.join(mockSrc2, "aliases.json"),
path.join(mockSrc2, 'widget', '**', '*'),
path.join(mockSrc2, 'module', '**', '*'),
path.join(mockSrc2, 'ipfs', '**', '*'),
path.join(mockSrc2, 'bos.config.json'),
path.join(mockSrc2, 'aliases.json'),
];
expect(mockAdd).toHaveBeenCalledWith(expectedWatchPaths);
});
Expand Down

0 comments on commit 787040a

Please sign in to comment.