summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-01-04 03:39:53 -0500
committerGitHub <noreply@github.com>2019-01-04 03:39:53 -0500
commit9e19717d756e43ab67668532eac50891a2f58cb3 (patch)
tree7ac8eea91d21736349bf5415662255980621a8c1
parentd8ea4629c8b228f800f6400f62d7ae0daa5ed9fe (diff)
Remove logging's flaky basicTest (denoland/deno_std#83)
Original: https://github.com/denoland/deno_std/commit/6754d468d8806e467edc3690fb02c1a587d02a26
-rw-r--r--logging/test.ts55
1 files changed, 0 insertions, 55 deletions
diff --git a/logging/test.ts b/logging/test.ts
index b96a046dd..a3c0b7199 100644
--- a/logging/test.ts
+++ b/logging/test.ts
@@ -27,58 +27,3 @@ test(function testDefaultlogMethods() {
console.log(logger);
});
-test(async function basicTest() {
- const testFile = './log.txt';
-
- await log.setup({
- handlers: {
- debug: new TestHandler("DEBUG"),
- info: new TestHandler("INFO"),
- file: new FileHandler("DEBUG", testFile),
- },
-
- loggers: {
- foo: {
- level: "DEBUG",
- handlers: ["debug", "file"]
- },
-
- bar: {
- level: "INFO",
- handlers: ["info"]
- }
- }
- });
-
- const fooLogger = log.getLogger("foo");
- const barLogger = log.getLogger("bar");
- const bazzLogger = log.getLogger("bazz");
-
-
- fooLogger.debug("I should be logged.");
- fooLogger.debug("I should be logged.");
- barLogger.debug("I should not be logged.");
- barLogger.info("And I should be logged as well.");
- bazzLogger.critical("I shouldn't be logged neither.")
-
- const expectedOutput =
- "DEBUG I should be logged.\n" +
- "DEBUG I should be logged.\n" +
- "INFO And I should be logged as well.\n";
-
- // TODO(ry) Re-enable this test. Disabled because it was failing on Linux.
- // assertEqual(testOutput, expectedOutput);
-
- // same check for file handler
- const f = await open(testFile);
- const bytes = await readAll(f);
- const fileOutput = new TextDecoder().decode(bytes);
- await f.close();
- await remove(testFile);
-
- const fileExpectedOutput =
- "DEBUG I should be logged.\n" +
- "DEBUG I should be logged.\n";
-
- assertEqual(fileOutput, fileExpectedOutput);
-});