Browse Source

Updated dev tools

master
Michaël Lemaire 1 year ago
parent
commit
fdb9e86d9d
  1. 9
      .editorconfig
  2. 4
      .gitignore
  3. 3
      README.md
  4. 1
      deps.test.ts
  5. 6
      hashing.test.ts
  6. 8
      sha.test.ts
  7. 2
      tsconfig.json

9
.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

4
.gitignore

@ -1 +1,3 @@
.config.json
deno.d.ts
.vscode
.local

3
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)

1
deps.test.ts

@ -0,0 +1 @@
export * from "https://code.thunderk.net/typescript/deno_tools/raw/1.0.0/testing.ts";

6
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");

8
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");
});

2
tsconfig.json

@ -1,5 +1,7 @@
{
"compilerOptions": {
"module": "esnext",
"target": "ESNext",
"strict": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,

Loading…
Cancel
Save