mirror of
https://github.com/denoland/deno.git
synced 2025-07-29 08:04:00 +00:00
Add flag --recompile (#801)
This commit is contained in:
parent
17a7b03d1b
commit
3fe4be07ca
6 changed files with 33 additions and 4 deletions
|
@ -458,6 +458,23 @@ test(function compilerGetScriptFileNames() {
|
|||
teardown();
|
||||
});
|
||||
|
||||
test(function compilerRecompileFlag() {
|
||||
setup();
|
||||
compilerInstance.run("foo/bar.ts", "/root/project");
|
||||
assertEqual(getEmitOutputStack.length, 1, "Expected only a single emitted file.");
|
||||
// running compiler against same file should use cached code
|
||||
compilerInstance.run("foo/bar.ts", "/root/project");
|
||||
assertEqual(getEmitOutputStack.length, 1, "Expected only a single emitted file.");
|
||||
compilerInstance.recompile = true;
|
||||
compilerInstance.run("foo/bar.ts", "/root/project");
|
||||
assertEqual(getEmitOutputStack.length, 2, "Expected two emitted file.");
|
||||
assert(
|
||||
getEmitOutputStack[0] === getEmitOutputStack[1],
|
||||
"Expected same file to be emitted twice."
|
||||
);
|
||||
teardown();
|
||||
});
|
||||
|
||||
test(function compilerGetScriptKind() {
|
||||
assertEqual(compilerInstance.getScriptKind("foo.ts"), ts.ScriptKind.TS);
|
||||
assertEqual(compilerInstance.getScriptKind("foo.d.ts"), ts.ScriptKind.TS);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue