Small improvements
This commit is contained in:
parent
19502cb967
commit
5624e51f52
9 changed files with 82 additions and 225 deletions
|
|
@ -42,7 +42,7 @@ function testUsesPauseServer(test: TestDefinition): boolean {
|
|||
*/
|
||||
function findProjectRoot(): string {
|
||||
let dir = path.dirname(__filename);
|
||||
const root = path.parse(dir).root;
|
||||
const {root} = path.parse(dir);
|
||||
while (dir !== root) {
|
||||
if (
|
||||
fs.existsSync(path.join(dir, "sync-server")) &&
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ export class DeterministicAgent extends debugging.InMemoryFileSystem {
|
|||
});
|
||||
}
|
||||
|
||||
const nextWriteRename = this.nextWriteRename;
|
||||
const { nextWriteRename } = this;
|
||||
if (
|
||||
nextWriteRename !== undefined &&
|
||||
nextWriteRename.oldPath === path
|
||||
|
|
|
|||
|
|
@ -239,8 +239,7 @@ export class ServerControl {
|
|||
public isRunning(): boolean {
|
||||
const proc = this.process;
|
||||
return (
|
||||
proc !== null &&
|
||||
proc.pid !== undefined &&
|
||||
proc?.pid !== undefined &&
|
||||
proc.exitCode === null &&
|
||||
proc.signalCode === null
|
||||
);
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ export class TestRunner {
|
|||
(entry) =>
|
||||
entry.details.type === step.syncType &&
|
||||
entry.details.relativePath === step.path,
|
||||
() => this.serverControl.pause()
|
||||
() => { this.serverControl.pause(); }
|
||||
);
|
||||
this.serverControl.resume();
|
||||
await historySeen;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import * as path from "path";
|
||||
import * as fs from "fs/promises";
|
||||
import * as fsSync from "fs";
|
||||
import type { NetworkConnectionStatus } from "sync-client";
|
||||
import type { NetworkConnectionStatus ,
|
||||
Logger} from "sync-client";
|
||||
import {
|
||||
SyncClient,
|
||||
DEFAULT_SETTINGS,
|
||||
Logger,
|
||||
LogLevel,
|
||||
LogLine,
|
||||
type SyncSettings,
|
||||
|
|
@ -41,7 +41,7 @@ const LOG_LEVEL_ORDER = {
|
|||
function createLogHandler(minLevel: LogLevel): (logLine: LogLine) => void {
|
||||
return (logLine: LogLine): void => {
|
||||
if (LOG_LEVEL_ORDER[logLine.level] >= LOG_LEVEL_ORDER[minLevel]) {
|
||||
// eslint-disable-next-line no-console
|
||||
|
||||
console.log(formatLogLine(logLine));
|
||||
}
|
||||
};
|
||||
|
|
@ -279,7 +279,7 @@ async function main(): Promise<void> {
|
|||
}
|
||||
|
||||
main().catch((error: unknown) => {
|
||||
// eslint-disable-next-line no-console
|
||||
|
||||
console.error(
|
||||
`Unexpected error: ${error instanceof Error ? error.message : String(error)}`
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env node
|
||||
/* eslint-disable no-console */
|
||||
|
||||
|
||||
/**
|
||||
* Healthcheck script for Docker container
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import type { RelativePath } from "../../persistence/database";
|
|||
import { Locks } from "./locks";
|
||||
import { awaitAll } from "../await-all";
|
||||
import { sleep } from "../sleep";
|
||||
import { SyncResetError } from "../../services/sync-reset-error";
|
||||
import { SyncResetError } from "../../errors/errors";
|
||||
|
||||
describe("withLock", () => {
|
||||
const testPath: RelativePath = "test/document/path";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { SyncResetError } from "../../services/sync-reset-error";
|
||||
import { SyncResetError } from "../../errors/errors";
|
||||
import type { Logger } from "../../tracing/logger";
|
||||
import { awaitAll } from "../await-all";
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,12 @@ const common = {
|
|||
rules: [
|
||||
{
|
||||
test: /\.ts$/,
|
||||
use: ["ts-loader"]
|
||||
use: [
|
||||
{
|
||||
loader: "ts-loader",
|
||||
options: { onlyCompileBundledFiles: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.wasm$/,
|
||||
|
|
|
|||
Loading…
Reference in a new issue