Remove assertion for empty modules (#1450)

This commit is contained in:
Satya Rohith 2019-01-04 08:39:07 +05:30 committed by Ryan Dahl
parent 4f62a56f90
commit 6be1164d89
2 changed files with 19 additions and 2 deletions

View file

@ -52,7 +52,7 @@ function mockModuleInfo(
};
}
// Some fixtures we will us in testing
// Some fixtures we will use in testing
const fooBarTsSource = `import * as deno from "deno";
console.log(deno);
export const foo = "bar";
@ -227,6 +227,14 @@ const moduleMap: {
"console.log('foo');",
undefined,
undefined
),
"empty_file.ts": mockModuleInfo(
"/moduleKinds/empty_file.ts",
"/moduleKinds/empty_file.ts",
MediaType.TypeScript,
"",
undefined,
undefined
)
}
};
@ -637,3 +645,13 @@ test(function compilerResolveModuleNames() {
}
teardown();
});
test(function compilerResolveEmptyFile() {
setup();
const result = compilerInstance.resolveModuleNames(
["empty_file.ts"],
"/moduleKinds"
);
assertEqual(result[0].resolvedFileName, "/moduleKinds/empty_file.ts");
teardown();
});