Skip to content

Commit

Permalink
fix: test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
wan2land committed Mar 20, 2024
1 parent 3e1e8e6 commit 49a7e5e
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"denoland.vscode-deno"
]
}
2 changes: 1 addition & 1 deletion ast/desugar.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "testing/asserts.ts";
import { assertEquals } from "assert/mod.ts";
import { desugar } from "./desugar.ts";
import { Kind, PrimitiveType } from "./ast.ts";

Expand Down
2 changes: 1 addition & 1 deletion ast/estimate_type.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "testing/asserts.ts";
import { assertEquals } from "assert/mod.ts";
import type { Equal, Expect } from "@type-challenges/utils";
import { type EstimateType } from "./estimate_type.ts";
import { Kind } from "./ast.ts";
Expand Down
2 changes: 1 addition & 1 deletion decorator/decorator.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "testing/asserts.ts";
import { assertEquals } from "assert/mod.ts";

import { Decorator } from "./decorator.ts";

Expand Down
2 changes: 1 addition & 1 deletion decorators.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals, assertThrows } from "testing/asserts.ts";
import { assertEquals, assertThrows } from "assert/mod.ts";
import { d } from "./decorators.ts";
import { decorate, union } from "./ast/utils.ts";
import { createSanitize } from "./validator/create_sanitize.ts";
Expand Down
12 changes: 6 additions & 6 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"imports": {
"dnt/": "https://deno.land/x/dnt@0.33.0/",
"testing/": "https://deno.land/std@0.179.0/testing/",
"@type-challenges/utils": "https://esm.sh/@type-challenges/utils@0.1.1/index.d.ts"
"dnt/": "https://deno.land/x/dnt@0.40.0/",
"assert/": "https://deno.land/std@0.220.1/assert/",
"@type-challenges/utils": "npm:@type-challenges/utils@0.1.1/index.d.ts"
},
"tasks": {
"test": "deno task test:unit && deno task test:lint && deno task test:format && deno task test:types",
"test:unit": "deno test -A --unstable",
"test:lint": "deno lint",
"test:format": "deno fmt --check",
"test:types": "find . -name '*.ts' | xargs deno check --unstable",
"test:lint": "deno lint --ignore=.npm",
"test:format": "deno fmt --check --ignore=.npm",
"test:types": "find . -name '*.ts' -not -path './.npm/*' | xargs deno check",
"build:npm": "deno run -A scripts/build_npm.ts"
}
}
11 changes: 7 additions & 4 deletions scripts/build_npm.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { build, emptyDir } from "dnt/mod.ts";

const cmd = Deno.run({ cmd: ["git", "describe", "--tags"], stdout: "piped" });
const version = new TextDecoder().decode(await cmd.output()).trim();
cmd.close();
const cmd = new Deno.Command(Deno.execPath(), {
args: ["git", "describe", "--tags"],
stdout: "piped",
});
const { stdout } = await cmd.output();
const version = new TextDecoder().decode(stdout).trim();

await emptyDir("./.npm");

Expand All @@ -14,7 +17,7 @@ await build({
},
test: false,
compilerOptions: {
lib: ["es2021", "dom"],
lib: ["ES2021", "DOM"],
},
package: {
name: "safen",
Expand Down
2 changes: 1 addition & 1 deletion short.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert, assertFalse } from "testing/asserts.ts";
import { assert, assertFalse } from "assert/mod.ts";
import { v } from "./short.ts";

Deno.test("short, validation, decorate", () => {
Expand Down
2 changes: 1 addition & 1 deletion validator/create_sanitize.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals, assertThrows } from "testing/asserts.ts";
import { assertEquals, assertThrows } from "assert/mod.ts";
import { between } from "../decorators/between.ts";
import { email } from "../decorators/email.ts";
import { ip } from "../decorators/ip.ts";
Expand Down
2 changes: 1 addition & 1 deletion validator/create_validate.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { between } from "../decorators/between.ts";
import { email } from "../decorators/email.ts";
import { lengthBetween } from "../decorators/length_between.ts";
import { assert, assertFalse } from "testing/asserts.ts";
import { assert, assertFalse } from "assert/mod.ts";
import { any, array, decorate, optional, or, union } from "../ast/utils.ts";
import { emptyToNull } from "../decorators/empty_to_null.ts";
import { ip } from "../decorators/ip.ts";
Expand Down

0 comments on commit 49a7e5e

Please sign in to comment.