Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bundle/run handles Deno.args better. #514

Merged
merged 1 commit into from
Jun 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bundle/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fixtureModules.set("modA", {
});

test(async function loadBundle(): Promise<void> {
const result = await load(["", "./bundle/testdata/bundle.js"]);
const result = await load(["", "./bundle/testdata/bundle.js", "--foo"]);
assert(result != null);
assert(
result.includes(
Expand All @@ -79,7 +79,7 @@ test(async function loadBadArgs(): Promise<void> {
await load(["bundle/test.ts"]);
},
AssertionError,
"Expected exactly two arguments."
"Expected at least two arguments."
);
});

Expand Down
4 changes: 2 additions & 2 deletions bundle/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.

import { assertStrictEq, assert } from "../testing/asserts.ts";
import { assert } from "../testing/asserts.ts";
import { exists } from "../fs/exists.ts";

export interface DefineFactory {
Expand Down Expand Up @@ -98,7 +98,7 @@ export function instantiate(
/** Load the bundle and return the contents asynchronously. */
export async function load(args: string[]): Promise<string> {
// TODO(kitsonk) allow loading of remote bundles via fetch.
assertStrictEq(args.length, 2, "Expected exactly two arguments.");
assert(args.length >= 2, "Expected at least two arguments.");
const [, bundleFileName] = args;
assert(
await exists(bundleFileName),
Expand Down