Skip to content

Commit

Permalink
Merge pull request #41 from drashland/issue-#40-fix-tests
Browse files Browse the repository at this point in the history
fix tests
  • Loading branch information
crookse authored Jul 23, 2020
2 parents d77d8c1 + c6e4e2a commit 4c10bf3
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,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
drash can be updated from v1.0.0 to v1.1.1
fs can be updated from 0.53.0 to 0.61.0
...
```
Expand All @@ -123,15 +123,15 @@ Lets update our dependencies as some are out of date:
```
$ dmm update
...
drash was updated from v1.0.0 to v1.0.7
drash was updated from v1.0.0 to v1.1.1
fs was updated from 0.53.0 to 0.61.0
...
```

Now lets check the `deps.ts` file, and you will notice the versions have been modified:

```typescript
export { Drash } from "https://deno.land/x/drash@v1.0.7/mod.ts"; // was out of date
export { Drash } from "https://deno.land/x/drash@v1.1.1/mod.ts"; // was out of date

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

Expand Down
4 changes: 2 additions & 2 deletions tests/check_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Deno.test({
"Gathering facts...\n" +
"Reading deps.ts to gather your dependencies...\n" +
"Comparing versions...\n" +
colours.yellow("drash can be updated from v1.0.0 to v1.0.7") + "\n" +
colours.yellow("drash can be updated from v1.0.0 to v1.1.1") + "\n" +
colours.yellow(
`fs can be updated from 0.53.0 to ${DenoService.getLatestStdRelease()}`,
) +
Expand Down Expand Up @@ -203,7 +203,7 @@ Deno.test({
"Gathering facts...\n" +
"Reading deps.ts to gather your dependencies...\n" +
"Comparing versions...\n" +
colours.yellow("drash can be updated from v1.0.0 to v1.0.7") + "\n" +
colours.yellow("drash can be updated from v1.0.0 to v1.1.1") + "\n" +
colours.yellow(
`fs can be updated from 0.53.0 to ${DenoService.getLatestStdRelease()}`,
) +
Expand Down
6 changes: 3 additions & 3 deletions tests/info_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ Deno.test({
"\n" +
" - Name: drash\n" +
" - Description: A REST microframework for Deno's HTTP server with zero dependencies.\n" +
" - deno.land Link: https://deno.land/x/drash@v1.0.7\n" +
" - deno.land Link: https://deno.land/x/drash@v1.1.1\n" +
" - GitHub Repository: https://github.com/drashland/deno-drash\n" +
' - Import Statement: import * as drash from \"https://deno.land/x/drash@v1.0.7\";\n' +
" - Latest Version: v1.0.7\n" +
' - Import Statement: import * as drash from \"https://deno.land/x/drash@v1.1.1\";\n' +
" - Latest Version: v1.1.1\n" +
"\n",
);
assertEquals(stderr, "");
Expand Down
4 changes: 3 additions & 1 deletion tests/up-to-date-deps/deps.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Drash } from "https://deno.land/x/drash@v1.0.7/mod.ts"; // up to date
import { Drash } from "https://deno.land/x/drash@v1.1.1/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.61.0/fmt/colors.ts"; // up to date

import { Drash as drash } from "https://deno.land/x/drash@v1.1.1/mod.ts"; // up to date

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

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

Expand Down
12 changes: 6 additions & 6 deletions tests/update_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ Deno.test({
"Gathering facts...\n" +
"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("drash was updated from v1.0.0 to v1.1.1") + "\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",
);
Expand All @@ -267,7 +267,7 @@ Deno.test({
assertEquals(newDepContent !== originalDepContent, 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);
assertEquals(newDepContent.indexOf("drash@v1.1.1") !== -1, true);
defaultDepsBackToOriginal("out-of-date-deps");
},
});
Expand Down Expand Up @@ -345,7 +345,7 @@ Deno.test({
"Gathering facts...\n" +
"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("drash was updated from v1.0.0 to v1.1.1") + "\n",
);
assertEquals(stderr, "");
assertEquals(status.code, 0);
Expand All @@ -357,7 +357,7 @@ Deno.test({
Deno.readFileSync("tests/out-of-date-deps/deps.ts"),
);
assertEquals(newDepContent !== originalDepContent, true);
assertEquals(newDepContent.indexOf("drash@v1.0.7") !== -1, true);
assertEquals(newDepContent.indexOf("drash@v1.1.1") !== -1, true);
defaultDepsBackToOriginal("out-of-date-deps");
},
});
Expand Down Expand Up @@ -439,7 +439,7 @@ Deno.test({
"Gathering facts...\n" +
"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("drash was updated from v1.0.0 to v1.1.1") + "\n" +
colours.green("fmt was updated from v0.53.0 to v0.61.0") + "\n",
);
assertEquals(stderr, "");
Expand All @@ -453,7 +453,7 @@ Deno.test({
);
assertEquals(newDepContent !== originalDepContent, true);
assertEquals(newDepContent.indexOf("std@v0.61.0/fmt") !== -1, true);
assertEquals(newDepContent.indexOf("drash@v1.0.7") !== -1, true);
assertEquals(newDepContent.indexOf("drash@v1.1.1") !== -1, true);
defaultDepsBackToOriginal("out-of-date-deps");
},
});
Expand Down

0 comments on commit 4c10bf3

Please sign in to comment.