diff --git a/log/mod.ts b/log/mod.ts index 4032937a2568..983e82401542 100644 --- a/log/mod.ts +++ b/log/mod.ts @@ -127,4 +127,4 @@ export async function setup(config: LogConfig): Promise { } } -setup(DEFAULT_CONFIG); +await setup(DEFAULT_CONFIG); diff --git a/log/mod_test.ts b/log/mod_test.ts new file mode 100644 index 000000000000..ceedcc85862a --- /dev/null +++ b/log/mod_test.ts @@ -0,0 +1,16 @@ +// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. +const { test } = Deno; +import { Logger } from "./logger.ts"; +import { assert } from "../testing/asserts.ts"; +import { getLogger } from "./mod.ts"; + +let logger: Logger | null = null; +try { + // Need to initialize it here + // otherwise it will be already initialized on Deno.test + logger = getLogger(); +} catch {} + +test("logger is initialized", function (): void { + assert(logger instanceof Logger); +});