Skip to content

Commit

Permalink
Maybe fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Jan 31, 2024
1 parent 95264e5 commit dd748e8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tasks": {
"build": "cp LICENSE js/LICENSE && deno run --unstable -A --no-check https://deno.land/x/wasmbuild@0.15.1/main.ts --no-default-features --project deno_graph_wasm --out js",
"build": "cp LICENSE js/LICENSE && deno run -A --no-check https://deno.land/x/wasmbuild@0.15.1/main.ts --no-default-features --project deno_graph_wasm --out js",
"build:npm": "deno run -A _build_npm.ts",
"test": "deno test --allow-read --allow-net"
},
Expand Down
2 changes: 1 addition & 1 deletion js/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export async function init(opts?: wasm.InstantiateOptions) {
*/
export function parseModule(
specifier: string,
content: string,
content: Uint8Array,
options: ParseModuleOptions = {},
): ModuleJson {
const {
Expand Down
28 changes: 14 additions & 14 deletions js/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,13 +538,13 @@ Deno.test({
await init();
const module = parseModule(
"file:///a/test01.js",
`
new TextEncoder().encode(`
/// <reference types="./test01.d.ts" />
import { a } from "./a.ts";
import * as b from "./b.ts";
export { c } from "./c.ts";
const d = await import("./d.ts");
`,
`),
);
assertEquals(module, {
"specifier": "file:///a/test01.js",
Expand Down Expand Up @@ -609,9 +609,9 @@ Deno.test({
await init();
const module = parseModule(
`https://example.com/a`,
`declare interface A {
new TextEncoder().encode(`declare interface A {
a: string;
}`,
}`),
{
headers: {
"content-type": "application/typescript; charset=utf-8",
Expand All @@ -628,10 +628,10 @@ Deno.test({
await init();
const module = parseModule(
`file:///a/test01.tsx`,
`/* @jsxImportSource http://example.com/preact */
new TextEncoder().encode(`/* @jsxImportSource http://example.com/preact */
export function A() {
<div>Hello Deno</div>
}`,
}`),
{
jsxImportSourceModule: "jsx-dev-runtime",
},
Expand All @@ -651,10 +651,10 @@ Deno.test({
await init();
const module = parseModule(
`file:///a/test01.tsx`,
`
new TextEncoder().encode(`
export function A() {
<div>Hello Deno</div>
}`,
}`),
{
defaultJsxImportSource: "http://example.com/preact",
},
Expand All @@ -673,7 +673,7 @@ Deno.test({
await init();
assertThrows(
() => {
parseModule("./bad.ts", `console.log("hello");`);
parseModule("./bad.ts", new TextEncoder().encode(`console.log("hello");`));
},
Error,
"relative URL without a base",
Expand All @@ -687,7 +687,7 @@ Deno.test({
await init();
assertThrows(
() => {
parseModule("file:///a/test.md", `# Some Markdown\n\n**bold**`);
parseModule("file:///a/test.md", new TextEncoder().encode(`# Some Markdown\n\n**bold**`));
},
Error,
"The module's source code could not be parsed",
Expand All @@ -701,10 +701,10 @@ Deno.test({
await init();
const module = parseModule(
"file:///a/test01.js",
`
new TextEncoder().encode(`
import a from "./a.json" with { type: "json" };
await import("./b.json", { with: { type: "json" } });
`,
`),
);
assertEquals(module, {
"dependencies": [
Expand Down Expand Up @@ -758,10 +758,10 @@ Deno.test({
await init();
const module = parseModule(
"file:///a/foo.ts",
`
new TextEncoder().encode(`
/// <reference path="./a.d.ts" />
/// <reference types="./b.d.ts" />
`,
`),
);
assertEquals(module, {
"dependencies": [
Expand Down

0 comments on commit dd748e8

Please sign in to comment.