All files / test/Common run.js

82.92% Statements 34/41
83.33% Branches 5/6
100% Functions 3/3
82.92% Lines 34/41

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 4243x 43x 43x 43x 246x 246x 43x 43x 252x 252x 43x 43x 11x 11x 43x 43x 43x 43x 43x     43x 43x 43x     43x 43x 43x 43x 43x 43x 43x 43x 43x 43x 43x       43x  
// Copyright (c) ZeroC, Inc.
 
class ControllerHelper {
    write(msg) {
        process.stdout.write(msg);
    }
 
    writeLine(msg) {
        process.stdout.write(msg + "\n");
    }
 
    serverReady() {
        console.log("server ready");
    }
}
 
(async function () {
    try {
        process.on("unhandledRejection", (reason, promise) => {
            console.error("Unhandled Rejection at:", promise, "reason:", reason);
            process.exit(1);
        });
 
        process.on("uncaughtException", err => {
            console.error("Uncaught Exception:", err);
            process.exit(1);
        });
 
        const path = process.argv[2];
        const name = process.argv[3];
        const module = await import(path);
        const cls = module[name];
 
        const test = new cls();
        test.setControllerHelper(new ControllerHelper());
        await test.run(process.argv);
    } catch (ex) {
        console.log(ex);
        process.exit(1);
    }
})();