From fdb9e86d9dbb1c52b5ee8d4ea37ccca2ab41b09c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Wed, 13 May 2020 14:22:56 +0200 Subject: [PATCH] Updated dev tools --- .editorconfig | 9 +++++++++ .gitignore | 4 +++- README.md | 3 +++ deps.test.ts | 1 + hashing.test.ts | 6 ++++-- sha.test.ts | 8 ++++---- tsconfig.json | 2 ++ 7 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 .editorconfig create mode 100644 README.md create mode 100644 deps.test.ts diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..83c1115 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*.{ts,json}] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true diff --git a/.gitignore b/.gitignore index aa62cbd..d69a4c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -.config.json \ No newline at end of file +deno.d.ts +.vscode +.local diff --git a/README.md b/README.md new file mode 100644 index 0000000..79f8366 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# typescript/passwordhash + +[![Build Status](https://thunderk.visualstudio.com/typescript/_apis/build/status/passwordhash?branchName=master)](https://dev.azure.com/thunderk/typescript/_build?pipelineNameFilter=passwordhash) diff --git a/deps.test.ts b/deps.test.ts new file mode 100644 index 0000000..727ba43 --- /dev/null +++ b/deps.test.ts @@ -0,0 +1 @@ +export * from "https://code.thunderk.net/typescript/deno_tools/raw/1.0.0/testing.ts"; diff --git a/hashing.test.ts b/hashing.test.ts index c31d6ce..3168297 100644 --- a/hashing.test.ts +++ b/hashing.test.ts @@ -1,7 +1,9 @@ -import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import { test, expect } from "./deps.test.ts"; import { Hasher, HashOutputMode } from "./hashing.ts"; -Deno.test("hasher", () => { +const assertEquals = (a: any, b: any) => expect(a).toEqual(b); + +test("hasher", () => { assertEquals(Hasher.tagFromURL(""), null); assertEquals(Hasher.tagFromURL("http://"), null); assertEquals(Hasher.tagFromURL("http://localhost"), "localhost"); diff --git a/sha.test.ts b/sha.test.ts index 5dde34a..136e7fe 100644 --- a/sha.test.ts +++ b/sha.test.ts @@ -1,7 +1,7 @@ -import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; +import { test, expect } from "./deps.test.ts"; import { hex_sha1 } from "./sha.ts"; -Deno.test("sha1", () => { - assertEquals(hex_sha1("abc"), "a9993e364706816aba3e25717850c26c9cd0d89d"); - assertEquals(hex_sha1("test"), "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"); +test("sha1", () => { + expect(hex_sha1("abc")).toEqual("a9993e364706816aba3e25717850c26c9cd0d89d"); + expect(hex_sha1("test")).toEqual("a94a8fe5ccb19ba61c4c0873d391e987982fbbd3"); }); diff --git a/tsconfig.json b/tsconfig.json index 99ece66..e28737f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,7 @@ { "compilerOptions": { + "module": "esnext", + "target": "ESNext", "strict": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true,