Skip to content

Commit

Permalink
Fixed tests and updated for Deno v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Bebbington committed Jul 14, 2020
1 parent 49b29ae commit 8e902aa
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bumper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
update-dep:
strategy:
matrix:
deno: ["1.1.1"]
deno: ["1.2.0"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
deno: ["1.1.1"]
deno: ["1.2.0"]
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -28,7 +28,7 @@ jobs:
linting:
strategy:
matrix:
deno: ["1.1.0"]
deno: ["1.2.0"]
# Doesn't need to be checked in all OS
runs-on: ubuntu-latest

Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ Information on fmt
- Name: fmt
- Description: Cannot retrieve descriptions for std modules
- deno.land Link: https://deno.land/std@0.60.0/fmt
- deno.land Link: https://deno.land/std@0.61.0/fmt
- GitHub Repository: https://github.com/denoland/deno/tree/master/std/fmt
- Import Statement: import * as fmt from "https://deno.land/std@0.60.0/fmt";
- Latest Version: 0.60.0
- Import Statement: import * as fmt from "https://deno.land/std@0.61.0/fmt";
- Latest Version: 0.61.0
```

Expand All @@ -97,7 +97,7 @@ export { Drash } from "https://deno.land/x/drash@v1.0.0/mod.ts"; // out of date

import * as fs from "https://deno.land/std@0.53.0/fs/mod.ts"; // out of date

import * as colors from "https://deno.land/std@0.60.0/fmt/colors.ts"; // up to date
import * as colors from "https://deno.land/std@0.61.0/fmt/colors.ts"; // up to date

export { fs, colors }
```
Expand All @@ -112,7 +112,7 @@ Now we want to check if any of our dependencies need updating, but we don't want
$ dmm check
...
drash can be updated from v1.0.0 to v1.0.7
fs can be updated from 0.53.0 to 0.60.0
fs can be updated from 0.53.0 to 0.61.0
...
```

Expand All @@ -124,7 +124,7 @@ Lets update our dependencies as some are out of date:
$ dmm update
...
drash was updated from v1.0.0 to v1.0.7
fs was updated from 0.53.0 to 0.60.0
fs was updated from 0.53.0 to 0.61.0
...
```

Expand All @@ -133,9 +133,9 @@ Now lets check the `deps.ts` file, and you will notice the versions have been mo
```typescript
export { Drash } from "https://deno.land/x/drash@v1.0.7/mod.ts"; // was out of date

import * as fs from "https://deno.land/std@0.60.0/fs/mod.ts"; // was out of date
import * as fs from "https://deno.land/std@0.61.0/fs/mod.ts"; // was out of date

import * as colors from "https://deno.land/std@0.60.0/fmt/colors.ts";
import * as colors from "https://deno.land/std@0.61.0/fmt/colors.ts";

export { fs, colors }
```
Expand Down
4 changes: 2 additions & 2 deletions tests/up-to-date-deps/deps.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Drash } from "https://deno.land/x/drash@v1.0.7/mod.ts"; // up to date

import * as fs from "https://deno.land/std@0.60.0/fs/mod.ts"; // up to date
import * as fs from "https://deno.land/std@0.61.0/fs/mod.ts"; // up to date

import * as colors from "https://deno.land/std@0.60.0/fmt/colors.ts"; // up to date
import * as colors from "https://deno.land/std@0.61.0/fmt/colors.ts"; // up to date

export { Drash, fs, colors };
4 changes: 2 additions & 2 deletions tests/up-to-date-deps/original_deps.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Drash } from "https://deno.land/x/drash@v1.0.7/mod.ts"; // up to date

import * as fs from "https://deno.land/std@0.60.0/fs/mod.ts"; // up to date
import * as fs from "https://deno.land/std@0.61.0/fs/mod.ts"; // up to date

import * as colors from "https://deno.land/std@0.60.0/fmt/colors.ts"; // up to date
import * as colors from "https://deno.land/std@0.61.0/fmt/colors.ts"; // up to date

export { Drash, fs, colors };
36 changes: 19 additions & 17 deletions tests/update_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ Deno.test({
const stdout = new TextDecoder("utf-8").decode(output);
const error = await p.stderrOutput();
const stderr = new TextDecoder("utf-8").decode(error);
assertEquals(
stdout,
"Gathering facts...\n" +
const expected =
"Gathering facts...\n" +
"Reading deps.ts to gather your dependencies...\n" +
"Checking if your modules can be updated...\n" +
colours.green("fs was updated from 0.53.0 to 0.60.0") + "\n",
colours.green("fs was updated from 0.53.0 to 0.61.0") + "\n"
assertEquals(
stdout,
expected
);
assertEquals(stderr, "");
assertEquals(status.code, 0);
Expand All @@ -74,7 +76,7 @@ Deno.test({
Deno.readFileSync("tests/out-of-date-deps/deps.ts"),
);
assertEquals(newDepContent !== originalDepContent, true);
assertEquals(newDepContent.indexOf("std@0.60.0/fs") !== -1, true);
assertEquals(newDepContent.indexOf("std@0.61.0/fs") !== -1, true);
defaultDepsBackToOriginal("out-of-date-deps");
},
});
Expand Down Expand Up @@ -156,8 +158,8 @@ Deno.test({
"Gathering facts...\n" +
"Reading deps.ts to gather your dependencies...\n" +
"Checking if your modules can be updated...\n" +
colours.green("fs was updated from 0.53.0 to 0.60.0") + "\n" +
colours.green("fmt was updated from v0.53.0 to v0.60.0") + "\n",
colours.green("fs was updated from 0.53.0 to 0.61.0") + "\n" +
colours.green("fmt was updated from v0.53.0 to v0.61.0") + "\n",
);
assertEquals(stderr, "");
assertEquals(status.code, 0);
Expand All @@ -169,8 +171,8 @@ Deno.test({
Deno.readFileSync("tests/out-of-date-deps/deps.ts"),
);
assertEquals(newDepContent !== originalDepContent, true);
assertEquals(newDepContent.indexOf("std@0.60.0/fs") !== -1, true);
assertEquals(newDepContent.indexOf("std@v0.60.0/fmt") !== -1, true);
assertEquals(newDepContent.indexOf("std@0.61.0/fs") !== -1, true);
assertEquals(newDepContent.indexOf("std@v0.61.0/fmt") !== -1, true);
defaultDepsBackToOriginal("out-of-date-deps");
},
});
Expand Down Expand Up @@ -251,8 +253,8 @@ Deno.test({
"Reading deps.ts to gather your dependencies...\n" +
"Checking if your modules can be updated...\n" +
colours.green("drash was updated from v1.0.0 to v1.0.7") + "\n" +
colours.green("fs was updated from 0.53.0 to 0.60.0") + "\n" +
colours.green("fmt was updated from v0.53.0 to v0.60.0") + "\n",
colours.green("fs was updated from 0.53.0 to 0.61.0") + "\n" +
colours.green("fmt was updated from v0.53.0 to v0.61.0") + "\n",
);
assertEquals(stderr, "");
assertEquals(status.code, 0);
Expand All @@ -264,8 +266,8 @@ Deno.test({
Deno.readFileSync("tests/out-of-date-deps/deps.ts"),
);
assertEquals(newDepContent !== originalDepContent, true);
assertEquals(newDepContent.indexOf("std@0.60.0/fs") !== -1, true);
assertEquals(newDepContent.indexOf("std@v0.60.0/fmt") !== -1, true);
assertEquals(newDepContent.indexOf("std@0.61.0/fs") !== -1, true);
assertEquals(newDepContent.indexOf("std@v0.61.0/fmt") !== -1, true);
assertEquals(newDepContent.indexOf("drash@v1.0.7") !== -1, true);
defaultDepsBackToOriginal("out-of-date-deps");
},
Expand Down Expand Up @@ -439,7 +441,7 @@ Deno.test({
"Reading deps.ts to gather your dependencies...\n" +
"Checking if your modules can be updated...\n" +
colours.green("drash was updated from v1.0.0 to v1.0.7") + "\n" +
colours.green("fmt was updated from v0.53.0 to v0.60.0") + "\n",
colours.green("fmt was updated from v0.53.0 to v0.61.0") + "\n",
);
assertEquals(stderr, "");
assertEquals(status.code, 0);
Expand All @@ -451,7 +453,7 @@ Deno.test({
Deno.readFileSync("tests/out-of-date-deps/deps.ts"),
);
assertEquals(newDepContent !== originalDepContent, true);
assertEquals(newDepContent.indexOf("std@v0.60.0/fmt") !== -1, true);
assertEquals(newDepContent.indexOf("std@v0.61.0/fmt") !== -1, true);
assertEquals(newDepContent.indexOf("drash@v1.0.7") !== -1, true);
defaultDepsBackToOriginal("out-of-date-deps");
},
Expand Down Expand Up @@ -488,7 +490,7 @@ Deno.test({
"Gathering facts...\n" +
"Reading deps.ts to gather your dependencies...\n" +
"Checking if your modules can be updated...\n" +
colours.green("fs was updated from 0.53.0 to 0.60.0") + "\n",
colours.green("fs was updated from 0.53.0 to 0.61.0") + "\n",
);
assertEquals(stderr, "");
assertEquals(status.code, 0);
Expand All @@ -500,7 +502,7 @@ Deno.test({
Deno.readFileSync("tests/out-of-date-deps/deps.ts"),
);
assertEquals(newDepContent !== originalDepContent, true);
assertEquals(newDepContent.indexOf("std@0.60.0/fs") !== -1, true);
assertEquals(newDepContent.indexOf("std@0.61.0/fs") !== -1, true);
defaultDepsBackToOriginal("out-of-date-deps");
},
});

0 comments on commit 8e902aa

Please sign in to comment.