Skip to content
This repository has been archived by the owner on Apr 14, 2020. It is now read-only.

Commit

Permalink
v0.2.9 & update test
Browse files Browse the repository at this point in the history
  • Loading branch information
zhmushan committed Feb 1, 2019
1 parent 2377a10 commit 960e014
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 37 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
language:
- python
- node_js

install:
- curl -L https://deno.land/x/install/install.py | python - v0.2.8
- curl -L https://deno.land/x/install/install.py | python - v0.2.9
- export PATH="$HOME/.deno/bin:$PATH"
- npm i -g http-server

script:
- deno --version
Expand Down
67 changes: 33 additions & 34 deletions test.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
import { run, readFileSync, exit, removeAll } from "deno";
import { assertEqual } from "https://deno.land/x/testing/mod.ts";
import { run, readFileSync, exit, remove } from "deno";
import {
assertEqual,
test,
runTests
} from "https://deno.land/x/testing/mod.ts";
import * as tmpl from "./tmpl.ts";

const projectName = "test_project";
test({
name: "deno init",
async fn() {
const status = await run({
args: [
"deno",
"mod.ts",
"--allow-write",
"--allow-run",
"--allow-env",
"--reload",
"--recompile",
projectName
]
}).status();

let hsStatus = null;
run({ args: ["hs", "-p", "8888"] })
.status()
.then(status => {
hsStatus = status;
});
setTimeout(() => {
run({
args: [
"deno",
"http://localhost:8888/mod.ts",
"--allow-write",
"--allow-run",
"--allow-env",
"--reload",
"--recompile",
projectName
]
})
.status()
.then(status => {
if (status.success) {
assertEqual(
new TextDecoder().decode(readFileSync(`${projectName}/mod.ts`)),
tmpl.modts
);
}
removeAll(projectName).then(() => {
exit(hsStatus);
});
});
}, 2000);
if (status.success) {
assertEqual(
new TextDecoder().decode(readFileSync(`${projectName}/mod.ts`)),
tmpl.modts
);
}
await remove(projectName, { recursive: true });
exit(status.code);
}
});

runTests();
Binary file modified types/deno.d.ts
Binary file not shown.

0 comments on commit 960e014

Please sign in to comment.