2020-02-24 08:31:40 -05:00
|
|
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
|
|
|
import { assertStrictEq } from "../../testing/asserts.ts";
|
|
|
|
|
|
|
|
Deno.test("[examples/welcome] print a welcome message", async () => {
|
|
|
|
const decoder = new TextDecoder();
|
|
|
|
const process = Deno.run({
|
|
|
|
args: [Deno.execPath(), "welcome.ts"],
|
|
|
|
cwd: "examples",
|
|
|
|
stdout: "piped"
|
|
|
|
});
|
|
|
|
try {
|
2020-03-18 19:25:55 -04:00
|
|
|
const output = await process.output();
|
2020-02-24 08:31:40 -05:00
|
|
|
const actual = decoder.decode(output).trim();
|
|
|
|
const expected = "Welcome to Deno 🦕";
|
|
|
|
assertStrictEq(actual, expected);
|
|
|
|
} finally {
|
|
|
|
process.close();
|
|
|
|
}
|
|
|
|
});
|