Skip to content

Commit

Permalink
Merge pull request #9 from hayd/0.42.0
Browse files Browse the repository at this point in the history
Update to deno 0.42.0
  • Loading branch information
hayd authored May 4, 2020
2 parents 1068621 + c0168aa commit 6380ac1
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: denolib/setup-deno@v1.2.0
- uses: denolib/setup-deno@master
with:
deno-version: 0.38.0
deno-version: 0.42.0
- run: deno test --allow-write
6 changes: 3 additions & 3 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export {
parse as parseArgs,
} from "https://deno.land/std@v0.41.0/flags/mod.ts";
export * as colors from "https://deno.land/std@v0.41.0/fmt/colors.ts";
export { decode, encode } from "https://deno.land/std@v0.41.0/encoding/utf8.ts";
} from "https://deno.land/std@v0.42.0/flags/mod.ts";
export * as colors from "https://deno.land/std@v0.42.0/fmt/colors.ts";
export { decode, encode } from "https://deno.land/std@v0.42.0/encoding/utf8.ts";
2 changes: 1 addition & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async function main(args: string[]) {
return help();
}

const depFiles: string[] = a._.map(x => x.toString());
const depFiles: string[] = a._.map((x) => x.toString());

if (depFiles.length === 0) {
help();
Expand Down
8 changes: 4 additions & 4 deletions registry_test.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { REGISTRIES, lookup } from "./registry.ts";
import { assert, assertEquals, FakeRegistry } from "./test_deps.ts";

Deno.test(function registryFakeregistry() {
Deno.test("registryFakeregistry", () => {
const url = "https://fakeregistry.com/foo@0.0.1/mod.ts";
const v = lookup(url, [FakeRegistry]);
assert(v !== undefined);
const vAt = v!.at("0.0.2");
assertEquals(vAt.url, "https://fakeregistry.com/foo@0.0.2/mod.ts");
});

Deno.test(function registryFakeregistryMissing() {
Deno.test("registryFakeregistryMissing", () => {
const url = "https://fakeregistry.com/foo@0.0.1/mod.ts";
const v = lookup(url, REGISTRIES);
assert(v === undefined);
});

Deno.test(function registryDenolandStd() {
Deno.test("registryDenolandStd", () => {
const url = "https://deno.land/std@0.35.0/foo.ts";
const v = lookup(url, REGISTRIES);
assert(v !== undefined);
Expand All @@ -24,7 +24,7 @@ Deno.test(function registryDenolandStd() {
assertEquals(vAt.url, "https://deno.land/std@0.1.0/foo.ts");
});

Deno.test(function registryDenolandX() {
Deno.test("registryDenolandX", () => {
const url = "https://deno.land/x/foo@0.1.0/foo.ts";
const v = lookup(url, REGISTRIES);
assert(v !== undefined);
Expand Down
2 changes: 1 addition & 1 deletion search_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { assertEquals } from "./test_deps.ts";
import { REGISTRIES } from "./registry.ts";
import { importUrls } from "./search.ts";

Deno.test(function denolandImports() {
Deno.test("denolandImports", () => {
const expected = [
"https://deno.land/std@0.35.0/foo.ts",
"https://deno.land/x/foo@0.35.0/foo.ts",
Expand Down
12 changes: 6 additions & 6 deletions semver_test.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
import { Semver } from "./semver.ts";
import { assert, assertEquals, assertThrows } from "./test_deps.ts";

Deno.test(function semver() {
Deno.test("semver", () => {
const v = new Semver("1.0.2");
assertEquals(v.major, 1);
assertEquals(v.minor, 0);
assertEquals(v.patch, 2);
});

Deno.test(function semverEq() {
Deno.test("semverEq", () => {
const v1 = new Semver("1.0.2");
assert(v1.eq(v1));
});

Deno.test(function SemverLt() {
Deno.test("SemverLt", () => {
const v1 = new Semver("1.0.2");
const v2 = new Semver("1.0.3");
assert(v1.lt(v2));
});

Deno.test(function semverTilde() {
Deno.test("semverTilde", () => {
const v1 = new Semver("1.0.2");
const v2 = new Semver("1.0.3");
assert(v1.tilde(v2));
});

Deno.test(function semverBad() {
Deno.test("semverBad", () => {
assertThrows(() => new Semver("bad.0.2"));
});

Deno.test(function semverToken() {
Deno.test("semverToken", () => {
const v1 = new Semver("1.0.2");
const v2 = new Semver("1.0.3");
assert(v1._("<", v2));
Expand Down
30 changes: 15 additions & 15 deletions test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ async function testUdd(
}
}

Deno.test(async function uddFakeregistry() {
Deno.test("uddFakeregistry", async () => {
const contents = 'import "https://fakeregistry.com/foo@0.0.1/mod.ts";';
const expected = 'import "https://fakeregistry.com/foo@0.0.2/mod.ts";';
await testUdd(contents, expected);
});

Deno.test(async function uddFakeregistryNotFound() {
Deno.test("uddFakeregistryNotFound", async () => {
const contents = 'import "https://fakeregistry.com/foo@0.0.3/mod.ts#=";';
const expected = 'import "https://fakeregistry.com/foo@0.0.3/mod.ts#=";';
const results = await testUdd(contents, expected);
Expand All @@ -44,39 +44,39 @@ Deno.test(async function uddFakeregistryNotFound() {
assertEquals("no compatible version found", results[0].message);
});

Deno.test(async function uddFakeDenolandStd() {
Deno.test("uddFakeDenolandStd", async () => {
const contents = 'import "https://deno.land/std@0.34.0/mod.ts";';
const expected = 'import "https://deno.land/std@0.35.0/mod.ts";';
await testUdd(contents, expected, [FakeDenoStd]);
});

Deno.test(async function uddFakeregistryEqToken() {
Deno.test("uddFakeregistryEqToken", async () => {
const contents = 'import "https://fakeregistry.com/foo@0.0.1/mod.ts#=0.0.1";';
const expected = 'import "https://fakeregistry.com/foo@0.0.1/mod.ts#=0.0.1";';
await testUdd(contents, expected);
});

Deno.test(async function uddFakeregistryTildeToken() {
Deno.test("uddFakeregistryTildeToken", async () => {
const contents = 'import "https://fakeregistry.com/foo@0.0.1/mod.ts#~0.0.1";';
const expected = 'import "https://fakeregistry.com/foo@0.0.2/mod.ts#~0.0.1";';
await testUdd(contents, expected);
});

Deno.test(async function uddFakeregistryLtToken() {
Deno.test("uddFakeregistryLtToken", async () => {
const contents = 'import "https://fakeregistry.com/foo@0.0.1/mod.ts#<0.1.0";';
const expected = 'import "https://fakeregistry.com/foo@0.0.2/mod.ts#<0.1.0";';
await testUdd(contents, expected);
});

Deno.test(async function uddFakeregistryLtTokenSpaces() {
Deno.test("uddFakeregistryLtTokenSpaces", async () => {
const contents =
'import "https://fakeregistry.com/foo@0.0.1/mod.ts# < 0.1.0";';
const expected =
'import "https://fakeregistry.com/foo@0.0.2/mod.ts# < 0.1.0";';
await testUdd(contents, expected);
});

Deno.test(async function uddFakeregistryInvalidFragmentSemver() {
Deno.test("uddFakeregistryInvalidFragmentSemver", async () => {
const contents =
'import "https://fakeregistry.com/foo@0.0.1/mod.ts# < 0.1.b";';
const expected =
Expand All @@ -87,7 +87,7 @@ Deno.test(async function uddFakeregistryInvalidFragmentSemver() {
assertEquals(results[0].message, "invalid semver version: 0.1.b");
});

Deno.test(async function uddFakeregistryInvalidFragmentFoo() {
Deno.test("uddFakeregistryInvalidFragmentFoo", async () => {
const contents = 'import "https://fakeregistry.com/foo@0.0.1/mod.ts#foo";';
const expected = 'import "https://fakeregistry.com/foo@0.0.1/mod.ts#foo";';
const results = await testUdd(contents, expected);
Expand All @@ -96,25 +96,25 @@ Deno.test(async function uddFakeregistryInvalidFragmentFoo() {
assertEquals(results[0].message, "invalid semver fragment: foo");
});

Deno.test(async function uddFakeregistryEq() {
Deno.test("uddFakeregistryEq", async () => {
const contents = 'import "https://fakeregistry.com/foo@0.0.1/mod.ts#=";';
const expected = 'import "https://fakeregistry.com/foo@0.0.1/mod.ts#=";';
await testUdd(contents, expected);
});

Deno.test(async function uddFakeregistryTilde() {
Deno.test("uddFakeregistryTilde", async () => {
const contents = 'import "https://fakeregistry.com/foo@0.0.1/mod.ts#~";';
const expected = 'import "https://fakeregistry.com/foo@0.0.2/mod.ts#~";';
await testUdd(contents, expected);
});

Deno.test(async function uddFakeregistryCaret() {
Deno.test("uddFakeregistryCaret", async () => {
const contents = 'import "https://fakeregistry.com/foo@0.0.1/mod.ts#^";';
const expected = 'import "https://fakeregistry.com/foo@0.0.2/mod.ts#^";';
await testUdd(contents, expected);
});

Deno.test(async function uddFakeMultiple() {
Deno.test("uddFakeMultiple", async () => {
const contents = `
import "https://deno.land/std@0.34.0/mod.ts";
import "https://deno.land/std@0.34.0/foo.ts";
Expand All @@ -139,13 +139,13 @@ import { bar } from "https://fakeregistry.com/foo@0.0.1/bar.ts#=";
assertEquals([true, undefined, true, true], results.map((x) => x.success));
});

Deno.test(async function uddFakeregistryFragmentMove() {
Deno.test("uddFakeregistryFragmentMove", async () => {
const contents = 'import "https://fakeregistry.com/foo@~0.0.1/mod.ts";';
const expected = 'import "https://fakeregistry.com/foo@0.0.2/mod.ts#~";';
await testUdd(contents, expected);
});

Deno.test(async function uddFakeregistryFragmentMoveEq() {
Deno.test("uddFakeregistryFragmentMoveEq", async () => {
const contents = 'import "https://fakeregistry.com/foo@=0.0.1/mod.ts";';
const expected = 'import "https://fakeregistry.com/foo@0.0.1/mod.ts#=";';
await testUdd(contents, expected);
Expand Down
2 changes: 1 addition & 1 deletion test_deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export {
assertEquals,
assertThrows,
assertThrowsAsync,
} from "https://deno.land/std@v0.36.0/testing/asserts.ts";
} from "https://deno.land/std@v0.42.0/testing/asserts.ts";

export class FakeRegistry implements RegistryUrl {
url: string;
Expand Down

0 comments on commit 6380ac1

Please sign in to comment.